You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Erxiang Liu <er...@us.ibm.com> on 2007/02/19 20:07:32 UTC

Problem posting login information and redirect


I have the same problem. I did a post and also setFollowRedirects to true.
But it did not go to the Location automatically. I had to
manually read the location from the header and then do a get again. Any
idea?

thanks,

Michelle



                                                                           
             Roland Weber                                                  
             <http-async@dubio                                             
             so.net>                                                    To 
                                       HttpClient User Discussion          
             02/19/2007 12:52          <httpclient-user@jakarta.apache.org 
             PM                        >                                   
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
             "HttpClient User          Re: Problem posting login           
                Discussion"            information (ajax)                  
             <httpclient-user@                                             
             jakarta.apache.or                                             
                    g>                                                     
                                                                           
                                                                           
                                                                           




Hello Marcelo,

> But this url has a redirect!

What is the problem? HttpClient typically follows redirects
automatically if configured to do that:
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/HttpMethod.html#setFollowRedirects(boolean)


There are few cases where HttpClient is not allowed to follow
the redirect without user interaction. In that case, your
application will get a 3xx response and you can take the
target URL from the "Location" header in the response.

hope that helps,
  Roland


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