At 09:19 PM 05/22/01 -0400, Kuo, David wrote:
>I know when you declare a HTTP::Request object for the "GET" method the
>arguments (name1=value1&name2=value2...) are part of URL. But how about the
>"POST" method? How do I send out the arguments to the web server? If the
>syntax "$request = new HTTP::Request('POST' => $url, [name1 => value1, name2
>=> value2, ...,]);" correct?


There's an example in perldoc LWP that shows a post request.  Here's part
of it.

  # Create a request
  my $req = new HTTP::Request POST =>
'http://www.perl.com/cgi-bin/BugGlimpse';
  $req->content_type('application/x-www-form-urlencoded');
  $req->content('match=www&errors=0');

  # Pass request to the user agent and get a response back
  my $res = $ua->request($req);

The docs are pretty good.

Bill Moseley
mailto:[EMAIL PROTECTED]

Reply via email to