Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: Capture HTTP Error in Perl

by hippo (Abbot)
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.

Replies are listed 'Best First'.
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 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1079866]
and the pool shimmers...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2017-08-20 19:47 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (317 votes). Check out past polls.