[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    Re: Problem using strict mode in httpclient
From:       Oleg Kalnichevski <olegk () apache ! org>
Date:       2007-03-25 15:30:36
Message-ID: 1174836636.4896.17.camel () okhost
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic