Now I got it, from lwpcook it's this way:

Lazy people use the HTTP::Request::Common module to set up a suitable POST request message (it handles all the escaping issues) and has a suitable default for the content_type:

  use HTTP::Request::Common qw(POST);
  use LWP::UserAgent;
  $ua = LWP::UserAgent->new;

  my $req = POST 'http://rt.cpan.org/Public/Dist/Display.html',
                [ Status => 'Active', Name => 'libwww-perl' ];

  print $ua->request($req)->as_string;


Thanks.



On 2013-7-25 18:30, Charles DeRykus wrote:
If I recall correctly, no it won't.  And,  you can confirm that by
examining:

         $req->as_string;


Probably the easiest way to do this is with HTTP::Request::Common which
will handle escaping the form parameters for you, eg,


    use HTTP::Request::Common;
    use LWP::UserAgent;


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to