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 Sat, 24 Apr 2010 05:00:50 GMT
Hi Oleg,
       can you give me the sample code that works for you.


On Fri, Apr 23, 2010 at 6:07 PM, Oleg Kalnichevski <olegk@apache.org> wrote:

> On Fri, 2010-04-23 at 17:01 +0530, Phani Sajja wrote:
> > Hi Oleg,
> >        Here is the complete log
> >
>
> Works without any problem for me
>
> [DEBUG] SingleClientConnManager - Get connection for route
> HttpRoute[{}->http://www.tkdl.res.in]
> [DEBUG] DefaultHttpClient - Attempt 1 to execute request
> [DEBUG] DefaultClientConnection - Sending request:
> GET /tkdl/langdefault/common/home.asp/ HTTP/1.1
> [DEBUG] headers - >> GET /tkdl/langdefault/common/home.asp/ HTTP/1.1
> [DEBUG] headers - >> Host: www.tkdl.res.in
> [DEBUG] headers - >> Connection: Keep-Alive
> [DEBUG] headers - >> User-Agent: Apache-HttpClient/4.0.1 (java 1.5)
> [DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 302
> Object moved
> [DEBUG] headers - << HTTP/1.1 302 Object moved
> [DEBUG] headers - << Connection: close
> [DEBUG] headers - << Date: Fri, 23 Apr 2010 12:38:42 GMT
> [DEBUG] headers - << Server: Microsoft-IIS/6.0
> [DEBUG] headers - << X-Powered-By: ASP.NET
> [DEBUG] headers - <<
> Location: /tkdl/includes/errhandler/myeh_500-100.asp?404;
> http://www.tkdl.res.in/tkdl/langdefault/common/home.asp/
> [DEBUG] DefaultRedirectHandler - Redirect requested to location
> '/tkdl/includes/errhandler/myeh_500-100.asp?404;
> http://www.tkdl.res.in/tkdl/langdefault/common/home.asp/'
> [DEBUG] DefaultHttpClient - Redirecting to
> '
> http://www.tkdl.res.in/tkdl/includes/errhandler/myeh_500-100.asp?404;http://www.tkdl.res.in/tkdl/langdefault/common/home.asp/'
> via HttpRoute[{}->http://www.tkdl.res.in]
> [DEBUG] DefaultClientConnection - Connection closed
> [DEBUG] DefaultHttpClient - Attempt 2 to execute request
> [DEBUG] DefaultClientConnection - Sending request:
> GET /tkdl/includes/errhandler/myeh_500-100.asp?404;
> http://www.tkdl.res.in/tkdl/langdefault/common/home.asp/ HTTP/1.1
> [DEBUG] headers - >>
> GET /tkdl/includes/errhandler/myeh_500-100.asp?404;
> http://www.tkdl.res.in/tkdl/langdefault/common/home.asp/ HTTP/1.1
> [DEBUG] headers - >> Host: www.tkdl.res.in
> [DEBUG] headers - >> Connection: Keep-Alive
> [DEBUG] headers - >> User-Agent: Apache-HttpClient/4.0.1 (java 1.5)
> [DEBUG] DefaultClientConnection - Receiving response: HTTP/1.1 200 OK
> [DEBUG] headers - << HTTP/1.1 200 OK
> [DEBUG] headers - << Date: Fri, 23 Apr 2010 12:38:42 GMT
> [DEBUG] headers - << Server: Microsoft-IIS/6.0
> [DEBUG] headers - << X-Powered-By: ASP.NET
> [DEBUG] headers - << Content-Length: 3413
> [DEBUG] headers - << Content-Type: text/html
> [DEBUG] headers - << Set-Cookie:
> ASPSESSIONIDCSDTRRCT=HHKHPPKADJGPLFGHFDHKCMDH; path=/
> [DEBUG] headers - << Cache-control: private
> [DEBUG] DefaultHttpClient - Connection can be kept alive indefinitely
>
>
>
> > 16:50:57,953 DEBUG SingleClientConnManager:195 - Get connection for route
> > HttpRoute[{}->http://172.31.100.14:3128->
> > http://www.tkdl.res.in/tkdl/langdefault/common/home.asp]
>
> You have mis-configured HttpClient because it obviously tries to connect
> to an invalid host
>
> http://www.tkdl.res.in/tkdl/langdefault/common/home.asp is not a host,
> it is a URL.
>
> Oleg
>
>
> ---------------------------------------------------------------------
> 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