commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ed Ludke" <edlu...@yahoo.com>
Subject RE: [HttpClient] 400 Bad Request
Date Sun, 17 Aug 2003 20:23:02 GMT
That was it - thanks!

> If I'm misreading the log and you're actually using HttpClient's
redirect please let us know

Nope.  Doing just like FormLoginDemo.java does, managing re-directs
myself.

> Either way the documentation should be updated to include a note about
handling relative redirects.

And/or maybe an update to the examples - those have been a great help .
. . as has your support on this mailing list, btw.

Thanks again and keep up the great work!

Ed


-----Original Message-----
From: adrian.sutton@ephox.com [mailto:adrian.sutton@ephox.com] 
Sent: Sunday, August 17, 2003 12:28 AM
To: commons-user@jakarta.apache.org
Subject: re: [HttpClient] 400 Bad Request


Hi Ed,
It looks like the server is returning a relative redirection and you're
treating it as absolute.  I believe this is a problem with out
documentation actually.  The server is returning:

Location: redir.asp

which should be combined with the original URL to get something like:

GET /original/path/redir.asp

Having a GET request path that doesn't start with a / is going to cause
a 400 response since the server doesn't know where to start looking for
the file.

If I'm misreading the log and you're actually using HttpClient's
redirect please let us know (the httpclient-dev list is probably a
better place) and we'll look into what support the standards require for
this and/or what we should do about it.

Either way the documentation should be updated to include a note about
handling relative redirects.

Regards,

Adrian Sutton.

Original Message:
>From: "Ed Ludke" <edludke@yahoo.com>
>To: "'Jakarta Commons Users List'" <commons-user@jakarta.apache.org>
>Subject: [HttpClient] 400 Bad Request
>Date: Sat, 16 Aug 2003 20:54:03 -0400

>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>"
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message