473,581 Members | 2,783 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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::lev el('+');
$ua = new LWP::UserAgent || die "$!";
$ua->proxy(['http', 'ftp'] => 'http://server/proxyname');

$req = new HTTP::Request 'GET',"http://www.perl.com/" || die "$!";
$ua->agent('Mozil la/4.03');
$req->proxy_authoriz ation_basic("us ername", "password") ;
$res = $ua->request($req ) || die "$!";
if ($res->is_success)
{ print $res->content }
else
{ print $res->error_as_HTM L }
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>internet gateway on servername</TITLE>
</HEAD>
<BODY>

<CENTER>
iPlanet 6.04 "internetgatewa y" instance on machinename
</CENTER>

</BODY>
</HTML>
Can any body please help me with this .
Thanks in advance
-Shekhar
Jul 19 '05 #1
0 2269

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
11797
by: La Jesus | last post by:
Hello - I am new to Perl, so sorry if this is a silly / ultra easy question. I am using LWP::UserAgent to POST a HTTP message to another website, and it works great. However, I can't figure out how to redirect the user to a script at the same time as the post. (i.e. emulate sumbitting a form and being sent to a page. $org_response =...
1
12645
by: Woogie | last post by:
When running the sample code below without a proxy the GET returns the expected data. When run with the $proxy uncommented the GET returns the content of the login page for the site being accessed. The site in the code is valid for ease of testing. I also am including the LWP debug info for each attempt. Can anyone explain this behavior...
2
6082
by: Vinay Gupta | last post by:
Hi, In a Perl to Tcl conversion project, I am planning to use the following Tcl extensions as a replacement for some Perl libraries. My development environment is Windows. Win32::OLE --> "DDE" or "OpTcl" LWP::UserAgent, HTTP::Request --> "Scotty" Net::Telnet --> "Expect" ('spawn telnet') I have used Expect but haven't used Scotty, DDE...
0
2876
by: Playker | last post by:
Hello I have a website on 2 servers. I want to make a script which checks is first server availbale (he often breaks down) and redirects to 1st or 2nd server. Script works well if an error is the 404 error, but it doesn't work if server doesn't answer (and that's what I want). Can anyone help me? This is the code: #!/usr/bin/perl ## ##
102
6746
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem never to send if-modified-since. But the strange thing is that Opera sends if-modified-since but when I reply with "HTTP/1.0 304 Not Modified" it is...
2
1476
by: haimk63 | last post by:
Hi ! I am beginner in PERL. I would like to know whether the LWP::UserAgent module? can be used in any server that supports PERL. Thanks
3
2175
by: powersakthi | last post by:
Hi All, I am using LWP::UserAgent and HTML::TreeBuilder to communicate to the below site Here is the website map: https://secure.server.com/index.htm which asks for two fields user_id user_pwd then submit button the form is submitted to https://secure.server.com/login.asp
4
4226
by: kkamath | last post by:
Hi, I use LWP::UserAgent to automate windows login process. I set the credentials using $ua->credentials("host:port","realm","id","password"); but it fetches only the current page requested. It fails for subsequent requests and pops up the windows form again to supply the credentials. I have created a cookie jar too but this doesnt help as the...
3
3327
by: cketcham | last post by:
All, I have the following code: use 5.010; use LWP::UserAgent; use URI::URL; use LWP::Debug qw(+); my $browser = LWP::UserAgent->new();
0
7804
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6563
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3809
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1409
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.