Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: LWP 400 Bad Request on POST

by BrowserUk (Patriarch)
on Nov 12, 2013 at 20:48 UTC ( [id://1062266]=note: print w/replies, xml ) Need Help??


in reply to LWP 400 Bad Request on POST

This works for me:

use LWP::Simple;; $c = get 'https://wsnet.sendwordnow.com/SessionManagement/2010/05/Publ +icSessionManagementService.svc?wsdl';; print $c;; <?xml version="1.0" encoding="utf-8"?><wsdl:definitions name="PublicSe +ssionManagementService" targetNamespace="http://tempuri.org/" ...

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: LWP 400 Bad Request on POST
by dsb (Chaplain) on Nov 13, 2013 at 14:18 UTC
    $c is undef when I try that. I'm guessing the proxy is screwing with the request somehow.


    dsb
    This @ISA my( $cool ) %SIG

      Open a local port. Send the same request (from your browser) a) to that local port directly (temporarily disabling the proxy); b) and via the proxy. Compare the requests received.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        It's a corporate proxy so I cannot disable it.

        however I have made a little progress insofar as understanding the issue. not so much for how to fix it.

        i used ig's suggestion on wireshark to watch the packet transfers. First thing I noticed is that the browser is doing a CONNECT request, not a POST. When I switched to a CONNECT method in the script I immediately got a 200 return code. Still no content though.

        after re-checking the packet capture I saw that after the initial CONNECT and 200, the browser and server do a short handshake dance followed by several application data packets coming from the server to the browser. The LWP request doesn't capture any of that since (I guess) they aren't direct responses to the original request.

        Just in case you were curious...


        dsb
        This @ISA my( $cool ) %SIG

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-03-19 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found