Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] How do you get the final redirect URL from Jetty HttpClient 9.0?

Hi,

On Thu, May 23, 2013 at 10:43 PM, jhwallingford <jhwallingford@xxxxxxxxx> wrote:
> If I use HttpClient to do a HTTP GET request for http://myco.com and the
> server does a 301 (Moved Perm) to http://www.myco.com, how do I get the
> final URL? HttpClient will follow the redirect(s) but when I get the
> onComplete with the result I see know way to get the final URL after all
> redirects. Is there a way to do this?

You can disable the follow of redirects, so that you get the
intermediate response with the Location header and then you have to
manually follow redirects.

Alternatively, you can register a RequestListener and you'll see all
requests that are sent by the HttpClient.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
http://intalio.com
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.


Back to the top