Share the post "How To Get The Last Redirect URL In Apache HttpClient"
Getting the redirect URL after you get or post a request is easy in Apache HttpClient. Just use the Header class like this:
|
1 2 3 |
HttpResponse response = httpclientobject.execute(httpostobject); Header locationHeader = response.getFirstHeader("location"); System.out.println(locationHeader.getValue()); |