On Thu, 18 Feb 2010 11:32:01 -0800, cerr wrote: > I'm trying to login to a ssl encrypted webinterface with authrization > uing LWP but I don't get authorized for some reason and i can't figure > out why not. > My code: > my $url = 'https://192.168.167.166/'; # Yes, HTTPS! my $browser = > LWP::UserAgent->new; > $browser->credentials( > 'https://192.168.167.166', > 'Configuration Software', > 'admin' => 'admin' > ); > my $response = $browser->get($url); > print $response->header('WWW-Authenticate')."\n"; die "Error at $url\n > ", $response->status_line, "\n Aborting" > unless $response->is_success; > print "Whee, it worked! I got that ", > $response->content_type, " document!\n"; > and i keep getting following in my console: > Basic realm="Configuration Software" > Error at https://192.168.167.166/ > 401 Authorization Required > Aborting at ./login.pl line 40. > What's the problem? I can log-in just fine using a browser... Thanks, > roN
Try using WWW::Mechanize and post your code if it doesn't work. It has much more straightforward credentialling interfaces (I know; I wrote one of them). -- Peter Scott http://www.perlmedic.com/ http://www.perldebugged.com/ http://www.informit.com/store/product.aspx?isbn=0137001274 -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/