David,

David E Culp - RR wrote:
> Is there a way to perform an automatic POST ?

This is a pretty wide-open question. I think the most common way
to handle POSTing is via HTTP::Request (see its manpage and the
other LWP manpages). Most uses are essentially trivial. I don't
know what you mean by automatic. Write back if this boilerplate
doesn't get you started.

HTH,
Christian

-----JAPH
#!/usr/local/bin/perl

use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;

my $email = '[EMAIL PROTECTED]';

my $useragent = new LWP::UserAgent;
   $useragent->from($email);    # whom to contact
   $useragent->agent($useragent->agent .
        " ($email; http://www.dfngdsfdlkgn.com/projectinfo/)"); #
whom to contact, plus information about this project
   $useragent->timeout(20);     # 20 second time-out (we'll also
wait additional time after a failed request)

my $request = new HTTP::Request POST =>
'http://www.elsewhere.tld/cgi-bin/perlthatcares.cgi';
   $request->content_type('application/x-www-form-urlencoded');
   $request->content('foo=bar');

my $response = $useragent->request($request);

if ($response->is_success)
{
        print $response->content;
}
else
{
        print "Phooey!\n";
}
-----JAPH

__________________________________________________________________
117 NW 15th Street # S107                            [EMAIL PROTECTED]
Gainesville, FL  32603-1973                         (352) 392-0851

Reply via email to