Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Capture HTTP Error in Perl

by hippo (Curate)
on Mar 26, 2014 at 23:20 UTC ( #1079866=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Capture HTTP Error in Perl
in thread Capture HTTP Error in Perl

The HTTP response code is just a number. It will be in the range 100 to 599 as given in the official IANA list. If you use LWP::UserAgent you can retrieve this number with the code method. If you should need to set the code (and I don't see why you should from what you've said so far) set it just to one of these integers and not to a message.

I am using Win32::NetAdmin to authrize my user with the user login from env variable. How do I bypass this with the UserAgent module?

I'm entirely unfamiliar with that module, and indeed with every module under Win32::* - you are on your own there. If it uses HTTP Basic Auth or if you supplant it with HTTP Basic Auth, then you could use the credentials method of LWP::UserAgent to authenticate.


Comment on Re^3: Capture HTTP Error in Perl
Select or Download Code
Re^4: Capture HTTP Error in Perl
by suzun30 (Acolyte) on Mar 27, 2014 at 19:41 UTC
    Hi hippo

    Thanks for the response. The Win32::netAdmin module basically verifies given the user id if he is part of a group who can access the site. My site is on a corporate intranet and needs to be authenticated via sso with no prompting for user id or password. The LWP::UserAgent module does seem to need the credentials aka the 'password' for the user to be authenticated I believe as far as I read through the documentation and in the http://www.ietf.org/rfc/rfc2617.txt http authentication methods .

    Bringing back to my original issue, I am just trying to capture the erratic 'Page cannot be displayed ' error here and tryin to figure out what is triggering it. Any experience with such a situation anyone? I am glad we have explored the known options so far. Appreciate any good advice. Thanks

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1079866]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2014-08-22 03:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (146 votes), past polls