in reply to HTTP Unblessed reference question
The required syntax for HTTP request is:
$fp_request = new HTTP::Request('POST', $url, [ $header, [$content]]);
Every HTTP transaction must have a valid header and then two \n\n. It may or may not have a body. You have two problems. 1) no header (this needs to be a reference to an HTTP::Headers object) and 2) syntax error with your square brackets - they are not literal, they indicate optional arguments!
use LWP::UserAgent; use strict; my $header = new HTTP::Header ( Name => 'value', Date => 'Wed, 03 Apr 2002 00:00:00 GMT', Content_Type => 'text/html' ); my $body = 'This is the body of the request!'; my $req = new HTTP::Request('POST', $url, $header, $body ); print $req->as_string
You may have been thinking of using HTTP::Request::Common which uses that sort of syntax to produce a query string formatted body from an array ref.
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|