hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Problem using strict mode in httpclient
Date Sun, 25 Mar 2007 15:30:36 GMT
On Sat, 2007-03-24 at 16:29 -0600, Darshak Thakore wrote:
> Hi,
> I am trying to use the httpclient with a postmethod for performing some
> action on a server that I have. Now if the action succeeds the server
> usually responds with a 302 message with a TEMPORARY_REDIRECT and the
> default behavior of the httpclient is to automatically send a GET to the
> new url. I want the httpclient to not do this as I want to
> programmatically read the 302 message. I believe according to the RFC,
> the client is not supposed to perform a GET without user action but most
> clients do. I tried to enable the 'makestrict()' method both on the
> httpclient and the postmethod but it still does the same thing. How do I
> stop the postmethod and/or the httpclient from automatically doing the
> redirect on a 302.
> Any help will be appreciated.

Darshak,

HttpMethod#setFollowRedirects() is your friend

Hope this helps

Oleg

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


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


Mime
View raw message