there are a lot of examples how to read url page content with java client. For example here is with apache http client ( http://hc.apache.org/httpclient-legacy/tutorial.html)
HttpClient client = new HttpClient();
GetMethod method = new GetMethod(url);
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
System.err.println("Method failed: " + method.getStatusLine());
}
byte[] responseBody = method.getResponseBody();
Here is my question: In page url can be redirect to other url after some time. For example in url www.mysite.com/xxx there is redirect after 5sec from javascript to url www.mysite.com/realpage/xxx, but you can not go directly to www.mysite.com/real-page/xxx, only with redirect.
<script type="text/javascript">
function go() {
document.location.href = "http://www.mysite.com/realpage/xxx";
}
window.setTimeout("go()",5000);
</script>
How to do get this redirect in java client, and how to get content of this page in java client ? Tnx !