hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phani Sajja <sajja.ph...@gmail.com>
Subject Re: Handling Redirects automatically in HttpClient4.0.1
Date Sun, 25 Apr 2010 07:24:52 GMT
Oleg,
     Even if I set HANDLE_REDIRECTS to true or remove the line "
httpclient.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, true);"
it is not working. Can you please try to run the sample code.

On Sat, Apr 24, 2010 at 3:32 PM, Oleg Kalnichevski <olegk@apache.org> wrote:

> On /24/42010 11:12, Phani Sajja wrote:
>
>> Oleg,
>>       It is true I am not getting the result. Getting 302 error. This is
>> not
>> the home page which I am accessing (check searchURI) . Try to run the code
>> and tell me what have u got.
>>
>>
>>
> You TURNED OFF redirect handling in YOUR code and now are asking me why
> HttpClient is not handling redirects automatically!? Hello!?
>
> Oleg
>
>
>  On Sat, Apr 24, 2010 at 2:24 PM, Oleg Kalnichevski<olegk@apache.org>
>>  wrote:
>>
>>
>>
>>> On Sat, 2010-04-24 at 11:49 +0530, Phani Sajja wrote:
>>>
>>>
>>>> Hi Oleg,
>>>>          Here is the sample code which I am trying to get the search
>>>>
>>>>
>>> results
>>>
>>>
>>>>     String host = "www.tkdl.res.in";
>>>>     String searchURI = "/tkdl/langdefault/common/TKDLSearch.asp?GL=Eng";
>>>>         DefaultHttpClient httpclient = new DefaultHttpClient();
>>>>
>>>>         httpclient.getCredentialsProvider().setCredentials(
>>>>                 new AuthScope("172.31.100.14", 3128),
>>>>                 new UsernamePasswordCredentials("user", "pass"));
>>>>
>>>>         HttpHost targetHost = new HttpHost(host);
>>>>         HttpHost proxy = new HttpHost("172.31.100.14", 3128);
>>>>
>>>>
>>>>
>>>>
>>> httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY,
>>>
>>>
>>>> proxy);
>>>>
>>>>
>>>>
>>> httpclient.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS,
>>>
>>>
>>>> false);
>>>>
>>>>
>>>>
>>> Ehhh? You are kidding, right?
>>>
>>> Oleg
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>


-- 
Regards
Phani. S

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message