C
Chandra
Hello gurus,
I am using LWP::Useragent perl module to get a url from the
www.
Code snippet:
#!perl -w
use LWP::UserAgent;
LWP:ebug::level('+');
$ua = new LWP::UserAgent || die "$!";
$ua->proxy(['http', 'ftp'] => 'http://server/proxyname');
$req = new HTTP::Request 'GET',"http://www.perl.com/" || die "$!";
$ua->agent('Mozilla/4.03');
$req->proxy_authorization_basic("username", "password");
$res = $ua->request($req) || die "$!";
if ($res->is_success)
{ print $res->content }
else
{ print $res->error_as_HTML }
This seems to work indifferently . Becuase every time i run this it
print a page with my proxy server name etc.
RESULT:
<HTML>
<HEAD>
<TITLE>internetgateway on servername</TITLE>
</HEAD>
<BODY>
<CENTER>
iPlanet 6.04 "internetgateway" instance on machinename
</CENTER>
</BODY>
</HTML>
Can any body please help me with this .
Thanks in advance
-Shekhar
I am using LWP::Useragent perl module to get a url from the
www.
Code snippet:
#!perl -w
use LWP::UserAgent;
LWP:ebug::level('+');
$ua = new LWP::UserAgent || die "$!";
$ua->proxy(['http', 'ftp'] => 'http://server/proxyname');
$req = new HTTP::Request 'GET',"http://www.perl.com/" || die "$!";
$ua->agent('Mozilla/4.03');
$req->proxy_authorization_basic("username", "password");
$res = $ua->request($req) || die "$!";
if ($res->is_success)
{ print $res->content }
else
{ print $res->error_as_HTML }
This seems to work indifferently . Becuase every time i run this it
print a page with my proxy server name etc.
RESULT:
<HTML>
<HEAD>
<TITLE>internetgateway on servername</TITLE>
</HEAD>
<BODY>
<CENTER>
iPlanet 6.04 "internetgateway" instance on machinename
</CENTER>
</BODY>
</HTML>
Can any body please help me with this .
Thanks in advance
-Shekhar