CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [rkellerjr] LWP Browser->Get Challenge: Edit Log



FishMonger
Veteran / Moderator

Aug 27, 2013, 10:16 AM


Views: 11862
Re: [rkellerjr] LWP Browser->Get Challenge

The get method you're using returns an HTTP::Response object and the next step would normally be to check the status of the response, which is done by doing something like this:

Code
if ($response->is_success) { 
# do something
}
else {
print $response->header;
die $response->status_line;
}


You may want to print the header within each of those blocks.

For specific info on which headers you should be looking for can be found in the related modules that are being used in these calls.

LWP http://search.cpan.org/~gaas/libwww-perl-6.05/lib/LWP.pm

LWP::UserAgent http://search.cpan.org/~gaas/libwww-perl-6.05/lib/LWP/UserAgent.pm

HTTP::Response http://search.cpan.org/~gaas/HTTP-Message-6.06/lib/HTTP/Response.pm

Additional info can be found in the links provided in the "SEE ALSO" section of the modules.


(This post was edited by FishMonger on Aug 27, 2013, 10:19 AM)


Edit Log:
Post edited by FishMonger (Veteran) on Aug 27, 2013, 10:19 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives