hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stuart White" <stuart.whi...@gmail.com>
Subject Re: HttpUriRequest.getURI() inconsistent behavior?
Date Fri, 19 Dec 2008 15:13:56 GMT
Then what is the appropriate way for me to determine where a request
was redirected to, regardless of whether it went through a proxy?
Thanks!

On Fri, Dec 19, 2008 at 7:51 AM, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Wed, 2008-12-17 at 13:34 -0600, Stuart White wrote:
>> The behavior of HttpUriRequest.getURI() seems to be inconsistent,
>> depending on whether the request goes through a proxy or not.
>>
>> For this example, I'm attempting to access http://zeroc.com/download.html.
>>
>> Please see the attached source code.  If I run this source code with
>> no proxy configured, getURI() returns:
>>
>> /download.html
>>
>> However, if I change the code to use a proxy, getURI() now returns:
>>
>> http://zeroc.com/download.html
>>
>> I've tested this both with the latest releases of httpcore and
>> httpclient as well as subversion revision 727427, and this behavior
>> occurs regardless.
>>
>> Is this expected behavior?
>
> Yes, it is. The URI of the request object corresponds to the Request-URI
> of the HTTP message. It is expected to be relative for direct requests
> and absolute for proxied ones.
>
> Hope this helps
>
> Oleg
>
>
>>  Thanks!
>>
>> ---------------------------------------------------------------------
>> 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
>
>

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


Mime
View raw message