Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
And wanted to use LWP::UserAgent to do it, how would it be done? I tried:POST http://www.perl.org/survey.cgi Content-Length: 61 Content-Type: application/x-www-form-urlencoded name=Gisle&email=gisle%40aas.no&gender=m&born=1964&trust=3%25
But that didn't work. Any help would be appreciated.require LWP::UserAgent; my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30, ); my $HTTPrequest = <<EOREQUEST; POST http://www.perl.org/survey.cgi Content-Length: 61 Content-Type: application/x-www-form-urlencoded name=Gisle&email=gisle%40aas.no&gender=m&born=1964&trust=3%25 EOREQUEST my $request = HTTP::Request->new($HTTPrequest); my $response = $ua->request($request); if ($response->is_success) { print $response->content; } else { print $response->error_as_HTML; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Creating A Request
by FamousLongAgo (Friar) on Nov 11, 2002 at 02:52 UTC | |
by Anonymous Monk on Nov 11, 2002 at 02:57 UTC | |
|
Re: Creating A Request
by sauoq (Abbot) on Nov 11, 2002 at 03:17 UTC | |
|
Re: Creating A Request
by dws (Chancellor) on Nov 11, 2002 at 03:35 UTC | |
|
Re: Creating A Request
by Enlil (Parson) on Nov 11, 2002 at 02:57 UTC | |
by Anonymous Monk on Nov 11, 2002 at 03:15 UTC | |
|
Re: Creating A Request
by dingus (Friar) on Nov 11, 2002 at 09:37 UTC |