andyford has asked for the wisdom of the Perl Monks concerning the following question:
So I coded it up like so:GET https://somesite.com/foo/bar;jsessionid=0001CxASgCKob1dDFdsSDSDF:- +1?requestor=AGE&doctype=Statement&docid=NTczMyT1LTc5LTMtMS0wLQ%3D%3D& +token=df99a322563f
But I get "400 Bad Request".$url = URI->new("https://somesite.com/foo/bar;jsessionid=$jsession +Id"); $url->query_form( requestor => 'AGE', doctype => 'Statement', docid => $docid, token => $token, ); $response = $agent->get($url);
The above code is the last step of a five stage process where I log in, navigate, collect cookies and headers and whatnot to fill in the variables.
I have verified that all the previous steps work great with nice return codes and the HTML content is just as it should be, matching what I get with a browser.
Since you can't really test your answers, wild guesses are OK in this thread :)
UPDATE:
Amazing Fact:
The HTML error page that is returned with my 400 actually contains a URL. The error page says that the URL is no good, but if I paste it into a web browser location line, it works and pulls the pdf file down.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP GET: '400 Bad Request'
by derby (Abbot) on Jun 29, 2006 at 18:36 UTC | |
by andyford (Curate) on Aug 07, 2006 at 17:19 UTC | |
|
Re: LWP GET: '400 Bad Request'
by samtregar (Abbot) on Jun 29, 2006 at 18:06 UTC | |
by traveler (Parson) on Jun 29, 2006 at 18:33 UTC | |
|
Re: LWP GET: '400 Bad Request'
by Anonymous Monk on Aug 08, 2006 at 03:39 UTC | |
|
Re: LWP GET: '400 Bad Request'
by Anonymous Monk on Aug 08, 2006 at 03:40 UTC |