in reply to Passing POST parameters
Essentially, you just do:
And that's that.# create a new LWP::UserAgent my $ua = new LWP::UserAgent; # create a new HTTP::Request, specifying # the POST method my $request = new HTTP::Request; # read in the content from STDIN; print "Enter in your content:\n"; my $content = join '', <STDIN>; # attach the content to the request # (change content-type to the appropriate type) $request->header('Content-Type' => 'text/plain'); $request->header('Content-Length' => length $content); $request->content($content); # send request and get a response my $response = $ua->request($request);
|
|---|