I use the following code to get the returned response code of an aspx page
HttpConnection connection
= (HttpConnection) Connector.open("http://company.com/temp1.aspx"
+ ";deviceside=true");
connection.setRequestMethod(HttpConnection.GET);
connection.setRequestProperty(HttpHeaders.HEADER_CONNECTION, "close");
connection.setRequestProperty(HttpHeaders.HEADER_CONTENT_LENGTH, "0");
int resCode = connection.getResponseCode();
It works fine. But what if the link "http://company.com/temp1.aspx" auto-redirects to another page; assume "http://noncompany.com/temp2.aspx" ? How can i get the response code which is returned from the second link (the one which the first link redirected to) ? Is there something like "follow redirection" to get the new response of the page whom was auto-redirected to ?
Thanks in advance.