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?


On Thu, May 23, 2013 at 10:43 PM, jhwallingford <jhwallingford@xxxxxxxxx> wrote:
> If I use HttpClient to do a HTTP GET request for and the
> server does a 301 (Moved Perm) to, 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?

I introduced HttpRedirector in 9.1 which will help you out for this use case.
You still need to do redirects manually, but it's a while loop of few lines.

Simone Bordet
Developer advice, training, services and support
from the Jetty & CometD experts.
Intalio, the modern way to build business applications.

Back to the top