in reply to Submitting a form w/ UserAgent
HTTP::Request::Common handles quoting and encoding for you. If you like your way better, you'll need the following:use HTTP::Request::Common qw( POST ); use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = POST 'http://perlmonks.org/index.pl', [node_id => '20494']; print $ua->request($req)->as_string;
before you call $ua->request() on it.$req->content_type('application/x-www-form-urlencoded'); $req->content('node_id=20494');
|
|---|