471,889 Members | 2,522 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,889 software developers and data experts.

Problem with LWP::USERAGENT

Hello gurus,
I am using LWP::Useragent perl module to get a url from the
www.
Code snippet:

#!perl -w

use LWP::UserAgent;
LWP::Debug::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
Jul 19 '05 #1
0 2202

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Woogie | last post: by
reply views Thread by Playker | last post: by
2 posts views Thread by haimk63 | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.