in reply to lwp autentification
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: lwp autentification
by PierreL (Novice) on Apr 23, 2008 at 08:30 UTC | |
by PierreL (Novice) on Apr 23, 2008 at 08:31 UTC |