views:

29

answers:

1

Hi all,

How do I get the final URL of a Http request when I use HttpMethod.setFollowRedirects(true). I am using apache Httpclient - GetMethod.

A: 

Have you tried method.getURI(), or as suggested by Stephen - method.getPath() ?

Bozho
Certainly the getPath() method is documented as returning the path used *after* redirections have been performed. The getURI() method doesn't say one way or the other, but it would be a reasonable assumption that it behaves the same way as getPath().
Stephen C