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 <[email protected]> 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<[email protected]>
>> 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: [email protected]
>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Regards
Phani. S