How do I know if a site is prompting me with basic authentication? I am attempting to use LWP to do basic authentication and for some reason it is not working.
Running the the following script:
use HTTP::Request::Common qw(POST);
my $ua = LWP::UserAgent->new();
my $req = POST 'http://home.sff.net/login.asp', [ username => 'jonatha
+nmark', RecordID => 4142];
print "The netloc is" , $req->url->netloc, ". ";
$ua->credentials($req->url->netloc, "home.sff.net", 'jonathanmark', 'n
my$content = $ua->request($req)->as_string;
print "Content is $content";
produces the following output:
The netloc is: home.sff.net. Content is HTTP/1.0 401 (Unauthorized) Ac
Date: Fri, 01 Mar 2002 01:46:04 GMT
Via: 1.1 Dyn-EH-NetCache (NetCache NetApp/5.1R2)
Server: Greyware Web Server
WWW-Authenticate: Basic realm="home.sff.net"
Client-Date: Fri, 01 Mar 2002 01:48:51 GMT
Error: Access is Denied.
If anyone has any idea I would really appreciate it.