Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
First thing I noticed is that the browser is doing a CONNECT request, not a POST.

A browser issuing a CONNECT request is typical for access to a HTTPS URL (instead of a HTTP URL). CONNECT bypasses most of the proxy (especially the filter logic), so it is usually restricted. Typically you are only allowed to connect to the HTTPS standard port 443, and no other port.

When I switched to a CONNECT method in the script I immediately got a 200 return code. Still no content though.

You should not have to change your code from POST to CONNECT, in fact, this should not work. LWP::UserAgent should issue a CONNECT request to the proxy, make a SSL connection to the HTTPS server, and issue your POST request through the SSL encrypted connection. When you issue a CONNECT manually, the proxy just answers 200 OK and switches to forwarding all data between your script and the destination server.

If you can access HTTPS URLs from a browser through the proxy, LWP::UserAgent should be able to do so, too. Try something simple first, like a GET request for https://www.google.com/. If that does not work, talk with the proxy admin, make him/her look into the proxy logfiles. Talk with the network admins, try to get a way out around the proxy (directly through the firewall).

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^5: LWP 400 Bad Request on POST by afoken
in thread LWP 400 Bad Request on POST by dsb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-03-19 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found