Does this work at your site? It certainly works on the test server at cornell. Note this server comes up if you are feeling lucky and Google for 'basic authentication test site' so it seems fair enough to leave the details in the script.
use LWP::UserAgent; my $url = "http://prism.library.cornell.edu/control/authBasic/authTest +/"; my ($servername) = $url =~ m!://([^/]+)!; my $port = 80; my $realm = 'User: test Pass:'; my $username = 'test'; my $password = 'this'; my $lwp = LWP::UserAgent->new( ); $lwp->cookie_jar( {} ); $lwp->credentials("$servername:$port", $realm, $username, $password); my $response = $lwp->get($url); print $response->as_string;
In reply to Re: lwp autentification
by tachyon-II
in thread lwp autentification
by PierreL
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |