From edludke@yahoo.com Sun Aug 17 20:22:57 2003 Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 37738 invoked from network); 17 Aug 2003 20:22:57 -0000 Received: from smtp015.mail.yahoo.com (216.136.173.59) by daedalus.apache.org with SMTP; 17 Aug 2003 20:22:57 -0000 Received: from c-24-129-75-56.se.client2.attbi.com (HELO LUCID) (edludke@24.129.75.56 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 17 Aug 2003 20:23:03 -0000 From: "Ed Ludke" To: "'Jakarta Commons Users List'" Subject: RE: [HttpClient] 400 Bad Request Date: Sun, 17 Aug 2003 16:23:02 -0400 Message-ID: <000001c364fd$5c32ea50$384b8118@LUCID> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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" >To: "'Jakarta Commons Users List'" >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 - -<< >"Object moved[\n]" >2003/08/16 19:15:54:062 GMT-05:00 [DEBUG] wire - -<< "

Object >Moved

This object may be found here.[\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 - -<< >"ErrorThe parameter is >incorrect. " > > >--------------------------------------------------------------------- >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