in reply to Creating A Request


Have you tried HTTP::Headers?
use HTTP::Headers; my $h = HTTP::Headers->new(); $h->header('Content-Length' => 61 ); $h->header('Content-Type' => 'application/x-www-form-urlencod ed'); my $request = HTTP::Request->new( 'POST', 'http://www.perl.org/survey. +cgi', $h ); my $response = $ua->request( $request ); ...
I think this is the correct usage, but it's untried. Check out the man pages for HTTP::Request and HTTP::Headers for more detail.

Replies are listed 'Best First'.
Re: Re: Creating A Request
by Anonymous Monk on Nov 11, 2002 at 02:57 UTC
    This won't work, because I need to use explicitly the form of:
    POST http://www.perl.org/survey.cgi Content-Length: 61 Content-Type: application/x-www-form-urlencoded name=Gisle&email=gisle40aas.no&gender=m&born=1964&trust=3%25
    As that's what my users will be inputting. In addition, can't some of this code not concern the headers? (The input will be a HTTP request, persuant to the appropriate RFCs.)