You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Ed Ludke <ed...@yahoo.com> on 2003/08/17 02:54:03 UTC

[HttpClient] 400 Bad Request

Hey all,

I'm trying to log into a several different sites and I've had success
with 2 outta 3.  The third gives me a 400 Bad Request and I'm not quite
sure why.  The response to the actual POST looks ok, but something goes
wrong with the redirects.  My test code is based on FormLoginDemo.java
that comes with the examples and I tried to change just the part that
was specific to the site that was being hit.

If anyone knows why I might be having a problem here, your help would be
greatly appreciated!

The important part of the wire log is below.  Names where changed to
protect the guilty but if that info's needed to look further into this,
I would be happy to provide it to someone directly.

Thanks in advance,
Ed

-- Wire Log --

2003/08/16 19:15:52:328 GMT-05:00 [DEBUG] wire - ->> "POST /login.asp
HTTP/1.1[\r][\n]"
2003/08/16 19:15:52:328 GMT-05:00 [DEBUG] wire - ->> "User-Agent:
Jakarta Commons-HttpClient/2.0rc1[\r][\n]"
2003/08/16 19:15:52:328 GMT-05:00 [DEBUG] wire - ->> "Host:
protecttheguilty.net[\r][\n]"
2003/08/16 19:15:52:328 GMT-05:00 [DEBUG] wire - ->> "Cookie:
ASPSESSIONIDCSSTSSDR=IFLECMCBDCJKEAFLIGEPAABE[\r][\n]"
2003/08/16 19:15:52:328 GMT-05:00 [DEBUG] wire - ->> "Content-Length:
51[\r][\n]"
2003/08/16 19:15:52:328 GMT-05:00 [DEBUG] wire - ->> "Content-Type:
application/x-www-form-urlencoded[\r][\n]"
2003/08/16 19:15:52:328 GMT-05:00 [DEBUG] wire - ->> "[\r][\n]"
2003/08/16 19:15:52:344 GMT-05:00 [DEBUG] wire - ->>
"OK=Enter+Premium+Members+Area&User=joeblow&PW=password"
2003/08/16 19:15:52:375 GMT-05:00 [DEBUG] wire - -<< "HTTP/1.1 100
Continue[\r][\n]"
2003/08/16 19:15:52:375 GMT-05:00 [DEBUG] wire - -<< "Server:
Microsoft-IIS/5.0[\r][\n]"
2003/08/16 19:15:52:375 GMT-05:00 [DEBUG] wire - -<< "Date: Sun, 17 Aug
2003 00:33:28 GMT[\r][\n]"
2003/08/16 19:15:52:375 GMT-05:00 [INFO] HttpMethodBase - -Discarding
unexpected response: HTTP/1.1 100 Continue
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "HTTP/1.1 302
Object moved[\r][\n]"
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "Server:
Microsoft-IIS/5.0[\r][\n]"
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "Date: Sun, 17 Aug
2003 00:33:30 GMT[\r][\n]"
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "Location:
redir.asp[\r][\n]"
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "Content-Length:
121[\r][\n]"
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "Content-Type:
text/html[\r][\n]"
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "Cache-control:
private[\r][\n]"
2003/08/16 19:15:54:062 GMT-05:00 [INFO] HttpMethodBase - -Redirect
requested but followRedirects is disabled
Login form post: HTTP/1.1 302 Object moved
Logon cookies:
- ASPSESSIONIDCSSTSSDR=IFLECMCBDCJKEAFLIGEPAABE
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<<
"<head><title>Object moved</title></head>[\n]"
2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "<body><h1>Object
Moved</h1>This object may be found <a HREF="">here</a>.</body>[\n]"
Redirect target: redir.asp
2003/08/16 19:15:54:109 GMT-05:00 [DEBUG] wire - ->> "GET redir.asp
HTTP/1.1[\r][\n]"
2003/08/16 19:15:54:109 GMT-05:00 [DEBUG] wire - ->> "User-Agent:
Jakarta Commons-HttpClient/2.0rc1[\r][\n]"
2003/08/16 19:15:54:109 GMT-05:00 [DEBUG] wire - ->> "Host:
protecttheguilty.net[\r][\n]"
2003/08/16 19:15:54:109 GMT-05:00 [DEBUG] wire - ->> "[\r][\n]"
Redirect: HTTP/1.1 400 Bad Request
2003/08/16 19:15:54:140 GMT-05:00 [DEBUG] wire - -<< "HTTP/1.1 400 Bad
Request[\r][\n]"
2003/08/16 19:15:54:156 GMT-05:00 [DEBUG] wire - -<< "Server:
Microsoft-IIS/5.0[\r][\n]"
2003/08/16 19:15:54:156 GMT-05:00 [DEBUG] wire - -<< "Date: Sun, 17 Aug
2003 00:33:30 GMT[\r][\n]"
2003/08/16 19:15:54:156 GMT-05:00 [DEBUG] wire - -<< "Connection:
close[\r][\n]"
2003/08/16 19:15:54:156 GMT-05:00 [DEBUG] wire - -<< "Content-Type:
text/html[\r][\n]"
2003/08/16 19:15:54:156 GMT-05:00 [DEBUG] wire - -<< "Content-Length:
87[\r][\n]"
2003/08/16 19:15:54:156 GMT-05:00 [DEBUG] wire - -<<
"<html><head><title>Error</title></head><body>The parameter is
incorrect. </body></html>"