Posted on 2007-03-21 18:47:42-07 by phinea
Authentication Error Not logged in LWP::UserAgent

Hi all! I am new in CPAN Perl. I am using LWP::UserAgent module and I am not sure if this problem I may ask in this module. I am trying to convert and HTML page to PDF. The problem is that only print the login page because user and password are not recognized and the application only prints the login page instead a HTML page that contains pictures and tables. I ve tested with:

use LWP::UserAgent; $ua = LWP::UserAgent->new; $req = HTTP::Request->new(GET => 'http://localhost/rt/'); $req->authorization_basic('root', 'mypassword'); print $ua->request($req)->as_string;
But I want to convert into PDF the URL http://localhost/rt/InformeReport.html?Queue=NOC_REDIMADRID&mystart=01-01-2007+20%3A47%3A58&myend=1 +9-03-2007+20%3A48%3A02&Pie3DGraph=pie3d
But I only get the loggin page without authorization. It seems the user and password are not taken I have tested this sentence before but without success $ua->request(POST 'http://localhost/rt/InformeReport.html?Queue=NOC_REDIMADRID&mystart=01-01-2007+2 +0%3A47%3A58&myend=19-03-2007+20%3A48%3A02&Pie3DGraph=pie3d',
Also I have tested this without success $ua->cookie_jar(HTTP::Cookies->new(file => "$ENV{HOME}/.cookies.txt"));

Also I ve tested overriding get_basic_credentials() in a subclass, but without success Can anyone help me? Thanks in advance Regards

Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.