You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Javi <ja...@yahoo.es> on 2004/04/19 02:34:59 UTC

HttpClient Post redirect problem

Hello,
I'm ussing the HttpClient and I'm not able to set the Redirect Property of the PostMehod to TRUE. I use the SetFollowRedirects to True, but when I debug, it does not change!


Regards,
Javi

RE: HttpClient Post redirect problem

Posted by ol...@bluewin.ch.
Javi,
PostMethod#setFollowRedirects has no absolutely no effect because the HTTP
protocol specification prohibits automatic POST method redirects, plain and
simple. HTTP agents should issue an HTTP GET in response to HTTP POST redirect.
Currently HttpClient is not able to do it automatically due to architectural
issues. For detailed explanations and suggested workaround please consult
HttpClient redirect guide:
<http://jakarta.apache.org/commons/httpclient/redirects.html>

Hope this helps

Oleg

>-- Original Message --
>Reply-To: "Jakarta Commons Users List" <co...@jakarta.apache.org>
>From: "Javi" <ja...@yahoo.es>
>To: <co...@jakarta.apache.org>
>Subject: HttpClient Post redirect problem
>Date: Mon, 19 Apr 2004 02:34:59 +0200
>
>
>Hello,
>I'm ussing the HttpClient and I'm not able to set the Redirect Property
of
>the PostMehod to TRUE. I use the SetFollowRedirects to True, but when I
debug,
>it does not change!
>
>
>Regards,
>Javi


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


RE: HttpClient Post redirect problem

Posted by JEAN REMI LECQ <jr...@easyvoyage.fr>.
me too ! The Redirect Property of the PostMehod stay FALSE even if I wrote
"myHttpMethod.setFollowRedirects(true)". Dispite all, the redirect is
coorectly following with this method given to me by Roland Weber (Thanks
Roland !). But the error log is always written  :
>
>1. make the POST request
>2. look for the "Location" header
>3. make the GET request to the Location
>
>The output you copied shows only the requests you send.
>The Location header is not in the request, it is in the
>response to step 1. Therefore, I suspect you made a
>mistake in step 2, possibly by looking in the wrong place.
>You need to do the following:
>
>Header location = postMethod.getResponseHeader("Location");
>
>where 'postMethod' is the method you executed in step 1.
>

jeanremi

-----Message d'origine-----
De : Javi [mailto:javiersa76@yahoo.es]
Envoyé : lundi 19 avril 2004 02:35
À : commons-user@jakarta.apache.org
Objet : HttpClient Post redirect problem


Hello,
I'm ussing the HttpClient and I'm not able to set the Redirect Property of
the PostMehod to TRUE. I use the SetFollowRedirects to True, but when I
debug, it does not change!


Regards,
Javi


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