jdvernon1976 has asked for the wisdom of the Perl Monks concerning the following question:
#!c:\perl\bin\perl.exe
use LWP::UserAgent;
$bup = 'http://ias4/error_403.html';
my $ua = LWP::UserAgent->new;
print "Content-type: text/html\r\n\r\n";
print $bup."\n";
my $req = HTTP::Request->new(GET => $bup);
$req->header('Accept' => 'text/html');
# send request
my $res = $ua->request($req);
# check the outcome
if ($res->is_success)
{ print $res->content; }
else
{ print "Error: " . $res->status_line . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP, Crypt-SSLeay, and CLI vs. WWW
by hardburn (Abbot) on Feb 24, 2004 at 17:53 UTC | |
by jdvernon1976 (Novice) on Feb 24, 2004 at 18:22 UTC | |
by dorko (Prior) on Feb 24, 2004 at 19:36 UTC | |
by jdvernon1976 (Novice) on Feb 24, 2004 at 21:36 UTC | |
|
Re: LWP, Crypt-SSLeay, and CLI vs. WWW
by freddo411 (Chaplain) on Feb 24, 2004 at 17:59 UTC | |
by Grygonos (Chaplain) on Feb 24, 2004 at 19:58 UTC |