commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean W. Ferguson" <seansli...@comcast.net>
Subject Re: [HttpClient] setFollowRedirects(true) on PostMethod
Date Tue, 26 Aug 2003 21:10:18 GMT
Well, I am doing a post to a servlet that just writes back data on the response. 
  No redirects or anything, and that exception gets thrown.  I'd prefer not to 
have to modify the httpclient code, but it makes no sense to me that it thinks a 
redirect is happening.

Michael Becke wrote:
> Hi Santos,
> 
> There's no way to make PostMethod automatically redirect, other than 
> subclassing and overriding setFollowRedirects().
> 
> I question if this is what you want though.  Generally a redirect on 
> post indicates that the post succeeded and that the response is to be 
> read from the redirected page.  So you would perform a POST to 
> http://somehost/form and be redirected to http://somehost/response.  You 
> would then want to do a GET on http://somehost/response.
> 
> In either case it is also possible to handle the redirect manually by 
> checking the response code and getting the location header.
> 
> Mike
> 
> Santos wrote:
> 
>> Hi all,
>>
>> I writing to ask you if there's any chance to setFollowRedirects(true)
>> to an instance of PostMethod. I've read in the source that "Entity
>> enclosing requests cannot be redirected without user intervention", but
>> I really need a way to get around this limitation. I know that this is
>> probably due to the HTTP POST spec itself, but I need to invoke an HTTP
>> POST that performs redirection.
>>
>> Thank you,
>> <§@nTº$ />
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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