commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Sutton" <>
Subject RE: [HttpClient] Post may not be redirected
Date Mon, 31 May 2004 21:18:01 GMT
Hi John,
The HTTP spec is very clear on this - POST requests *must* not be
redirected without user intervention.  As such HttpClient doesn't
automatically follow redirects with the PostMethod.  Even if it did that
wouldn't be the behaviour you are after anyway.  What IE and Mozilla do
when they get a redirect from a POST request is send a GET request to
the redirect URL instead of sending the POST again as they should (after
confirming with the user).  With the 2.0 architecture this behaviour
would not be possible in HttpClient even if we wanted to implement it,
however it is simple to implement yourself.  Take a look at  for
information on handling redirects that HttpClient can't or doesn't


Adrian Sutton.

-----Original Message-----
From: John Patterson [] 
Sent: Tuesday, 1 June 2004 3:20 AM
To: Jakarta Commons Users List
Subject: [HttpClient] Post may not be redirected

When I try to set PostMethod.setFollowRedirects(true) an exception is
stating that this is not allowed with "Entity Enclosing requests".
the server that I access does return a 302 for POST requests.  Again,
IE and Mozilla allow this so it might be a good idea to change this
behaviour.  Perhaps it could be a configurable HttpMethodParam.


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message