From the lwpcook doc http://www.linpro.no/lwp/libwww-perl/lwpcook.pod comes this generic http client - in my time of need this did it for me:
#!/usr/local/bin/perl -w
use LWP::UserAgent;
$myurl = "http://www.perlmonks.org";
$ua = new LWP::UserAgent; $ua->agent("$0/0.1 " . $ua->agent);
$ua->agent("Mozilla/8.0");
# pretend we are very capable browser
$req = new HTTP::Request 'GET' => "$myurl";
$req->header('Accept' => 'text/html');
# send request $res = $ua->request($req);
# check the outcome if ($res->is_success) {
print $res->content;
#All this means is you got some html back . . .
}
else {
print "Error: " . $res->status_line . "\n";
}
In reply to Re: HTTP client in perl
by lostcause
in thread HTTP client in perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |