in reply to Basic authentication with LWP::UserAgent
The trick to LWP authentication is subclassing LWP::UserAgent.
package MyAgent; use base 'LWP::UserAgent'; sub get_basic_credentials { return 'admin', 'password'; } package main; my $agent = MyAgent->new; my $response = $agent->get( 'http://192.168.0.1/st_devic.html' ); print $response->code;
WFM
--
"To err is human, but to really foul things up you need a computer." --Paul Ehrlich
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Basic authentication with LWP::UserAgent
by abeal (Initiate) on Nov 14, 2003 at 07:09 UTC |