Re: Not able to use LWP::UserAgent::Authenticated
- From: John Bokma <john@xxxxxxxxxxxxxxx>
- Date: 27 Dec 2005 06:52:31 GMT
"HP" <hirendra_a@xxxxxxxxxxxxxx> wrote:
> my $ua = LWP::UserAgent::Authenticated->new( $LOGINID, $PASSWORD );
>
> its giving me error
Couldn't find this module on CPAN
> i have installed the LWP
Doesn't seem to be part of LWP.
> please help me out
my $req = HTTP::Request->new( GET => "http://....." );
$req->authorization_basic( "user", "password" );
works for me.
See also perldoc lwpcook
"
ACCESS TO PROTECTED DOCUMENTS
Documents protected by basic authorization can easily be accessed like
this:
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$req = HTTP::Request->new(GET => 'http://www.linpro.no/secret/');
$req->authorization_basic('aas', 'mypassword');
print $ua->request($req)->as_string;
The other alternative is to provide a subclass of LWP::UserAgent that
overrides the get_basic_credentials() method. Study the lwp-request
program for an example of this."
--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)
.
- Follow-Ups:
- References:
- Prev by Date: Not able to use LWP::UserAgent::Authenticated
- Next by Date: Re: Not able to use LWP::UserAgent::Authenticated
- Previous by thread: Not able to use LWP::UserAgent::Authenticated
- Next by thread: Re: Not able to use LWP::UserAgent::Authenticated
- Index(es):
Relevant Pages
|
|