When I'm picking up the response of a site with JSOUP, I can capture all headers except the LOCATION.
With JSOUP or some other html parser there some way to capture the value of the response header "LOCATION"?
When I'm picking up the response of a site with JSOUP, I can capture all headers except the LOCATION.
With JSOUP or some other html parser there some way to capture the value of the response header "LOCATION"?
You can read Location with JSoup.
Real example
Connection.Response response = Jsoup
.connect("http://tvnwarszawa.pl/d")
.method(Connection.Method.POST)
.followRedirects(false)
.execute();
System.out.println(response.header("Location"));
Output
http://tvnwarszawa.tvn24.pl/d
Read more about Location: http://en.wikipedia.org/wiki/HTTP_location
Maybe you are interested in url()?
System.out.println(response.url());