KarthikK has asked for the wisdom of the Perl Monks concerning the following question:
I came to know from my server admin that the proxy request is sent as annonymous, eventhough I have specified my NT_user and password in the proxy url.use strict; use LWP; use LWP::UserAgent; use LWP::Debug qw(+); my $URI = 'https://site.com/cc/login.do'; my $user = 'user'; my $pass = 'pwd'; # define user agent my $ua = LWP::UserAgent->new(); $ua->agent("USER/AGENT/IDENTIFICATION"); #set proxy $ua->proxy(['http','https'], 'http://nt_user:nt_pwd@proxy.domain.com:8 +080'); # make request my $request = HTTP::Request->new(GET => $URI); # authenticate $request->authorization_basic($user, $pass); # except response my $response = $ua->request($request); # get content of response my $content = $response->content(); # do whatever you need to do with the content here print $content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP and proxy authentication
by almut (Canon) on Oct 29, 2007 at 19:18 UTC | |
by KarthikK (Sexton) on Oct 30, 2007 at 07:59 UTC | |
|
Re: LWP and proxy authentication
by naikonta (Curate) on Oct 29, 2007 at 18:11 UTC |