http://www.perlmonks.org?node_id=982746


in reply to LWP fails where browser succeeds?

Try the same thing in your browser but with Javascript disabled (I recommend to clear cookies too).

Sometimes some sites set cookies via Javascript and if your agent doesn't execute Javascript you'll have "Bad request" error.

I'm using Firefox HTTPFox for this: just record the session and after that compare cookies send to you from site and cookies send by your browser on next request.

Anyway you need to send exactly same request to the target site (I mean button coordinates, empty form fields etc) to get it work.I