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 "Christophe Bouhier (MC/ECM)" <Ch...@ericsson.com> on 2005/01/28 10:05:20 UTC

redirect returning 200(ok)?

I have deployed the HTTP-Client in my application. (jpodder.com)
I am generally very happy with features and performance of HTTP-Client. 

I have this URL which is treated as a redirect by Internet Explorer, but when passed to
HTTP client returns a 200 OK. For sure this link is a redirect, but I would expect a  3xx code, 
to get the new location (And file name). 

This is the URL:

http://musiclink.abstrakt.hu/?action=listen&amp;id=768


Am I overlooking something?

How do I get the redirect location/URL from a 200OK? 

Is it it possible to debug and see the HTTP response? 

Thank You / Christophe

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


Re: redirect returning 200(ok)?

Posted by Oleg Kalnichevski <ol...@apache.org>.
Christophe,

Please note that redirect to another URL may be executed using
JavaScript code embedded in the original HTML page. Unlike IE HttpClient
doesn't process the content it retrieves

Oleg


On Fri, Jan 28, 2005 at 05:05:20PM +0800, Christophe Bouhier (MC/ECM) wrote:
> I have deployed the HTTP-Client in my application. (jpodder.com)
> I am generally very happy with features and performance of HTTP-Client. 
> 
> I have this URL which is treated as a redirect by Internet Explorer, but when passed to
> HTTP client returns a 200 OK. For sure this link is a redirect, but I would expect a  3xx code, 
> to get the new location (And file name). 
> 
> This is the URL:
> 
> http://musiclink.abstrakt.hu/?action=listen&amp;id=768
> 
> 
> Am I overlooking something?
> 
> How do I get the redirect location/URL from a 200OK? 
> 
> Is it it possible to debug and see the HTTP response? 
> 
> Thank You / Christophe
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 

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


Re: redirect returning 200(ok)?

Posted by Roland Weber <RO...@de.ibm.com>.
Hi Christophe,

> I have this URL which is treated as a redirect by Internet Explorer,
> but when passed to
> HTTP client returns a 200 OK. For sure this link is a redirect, but 
> I would expect a  3xx code, 
> to get the new location (And file name). 

HttpClient handles some redirects automatically. If you don't want
that, use HttpMethod.setFollowRedirects(false)

> How do I get the redirect location/URL from a 200OK? 

You don't ;-)

> Is it it possible to debug and see the HTTP response? 
> 
You can enable the wire log. For instructions, see
http://jakarta.apache.org/commons/httpclient/logging.html


hope that helps,
  Roland