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
In reply to Re: Basic authentication with LWP::UserAgent
by LTjake
in thread Basic authentication with LWP::UserAgent
by abeal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |