"Marko Schilde" <[EMAIL PROTECTED]> writes:
> I am new to libwww, so apologies if my questions seem pretty dumb to you...
>
> Hmmm... I want to something pretty simple ... post data to an external script. From
>what I've read it would be accomplished with
>
> $req2 = new HTTP::Request POST => $posturl;
>
> $req2->content_type('application/x-www-form-urlencoded');
>
> $req2->content('value1=$val1&value2=$val2');
>
> my $res2 = $ua->request($req);
>
> I got this code [well, the general idea] from the documentation of libwww .... now
>my question: Is there an easy method to encode the form values?
use HTTP::Request::Common qw(POST);
There is an example in lwpcook.pod
> DO they need to be encoded?
Yes. If your $val variables contain the characters "&" or "=" then
the form decoder in the server will be confused.
Regards,
Gisle