469,609 Members | 2,142 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

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 2121

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 Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.