in reply to Posting form data from within a virtual browser
I tend to use LWP::UserAgent for this, like so:
my $ua = new LWP::UserAgent; my $req = new HTTP::Request POST => "http://$url"; $req->content_type('application/x-www-form-urlencoded'); $req->content("param=data to send to the client"); # note - should be + URL encoded my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { return $res->content; } else { return $res->error_as_HTML; }
|
|---|