in reply to Re: LWP and server-side exception propogation
in thread LWP and server-side exception propogation

Yeah, I had it under a graphical debugger (from ActiveState's PDK) and saw the dump there. There was nothing showing anything but the 400.

I originally thought it might be a server configuration issue until I saw the desired error details shown by the CURL client tool.

  • Comment on Re^2: LWP and server-side exception propogation

Replies are listed 'Best First'.
Re^3: LWP and server-side exception propogation
by afoken (Chancellor) on Oct 08, 2009 at 05:54 UTC

    One difference between LWP and curl is the User-Agent header in the request. Some servers and server-side applications look at that header (stupid idea, as the client can fake any user agent) and try to block some user agents (more stupid), either using a blacklist of "evil" ones or a whitelist of "good" ones (even more stupid).

    I don't think your code behaves like this, but perhaps a library you use on the server side has this nonsense behaviour. Try sending the request from LWP with curl's User-Agent header. If that works, look at your code, the library documentations for the server side, and finally the web server configuration and documentation.

    As a side note, I don't generally trust debuggers and rich IDEs. Try adding $response->dump() to your client code. Note that this method behaves like print $response->dump() when called in void context. So, if you want the dump on STDERR or in a log file, call it in a non-void context and write out the dump manually.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re^3: LWP and server-side exception propogation
by Anonymous Monk on Oct 08, 2009 at 07:28 UTC
    I originally thought it might be a server configuration issue until I saw the desired error details shown by the CURL client tool.

    Right, sure, absolutely, whatever you say :D

      Well just to close this issue, this ended up being my problem. The error was in the content but was buried inside a ton of HTML code.