commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Becke <>
Subject [HttpClient] Re: How to get the base URI??
Date Tue, 27 Jan 2004 13:38:21 GMT
Hi Davide,

Yes, it looks like <> redirects to 
<> with a 301 redirect response.  
HttpClient automatically handles this redirection, unless you disable 
redirection.  When redirected, the original headers are overwritten.  
You can get the final path from the HttpMethod using 


On Jan 25, 2004, at 5:14 AM, Davide wrote:

> Hi all! I'm a really newbye and i'm in a mess with the following thing:
> I'm creating a class to resolve relative links given a base uri; Now I 
> use as base uri the uri I typed; but sometimes the remote web server 
> redirects my request to other pages and i can't know what is the real 
> base uri
> for example i'm having problems with this:
> in a page I have an a element with href=
> then i notice dusing a browser that the request changes in 
> (i see in the address bar)
> so a "/" is added in the end, that is very different when i compute 
> the base uri
> I think that this change is due to a redirection, but i don't know how 
> to make it available to my class;
> i tried using:
> Header locationHeader = method.getResponseHeader("location");
> redirectLocation = locationHeader.getValue();
> i read it in 
> because i read that the base uri is stored in the response header, but 
> without success;so how can I do it?
> for example, how can my browser(mozilla) know that 
> changes in ??
> Best Regards, Davide

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message