I\'m connecting to a remote server with apache http client. the remote server sends a redirect, and i want to achieve that my client isn\'t following the redirect automatica
To avoid automatic redirection header, one must first configure the request to not do automatic redirects. You can do this by calling HttPClientParams.setRedirection and set it to false. Code snippet is shown below:
HttpPost postURL = new HttpPost(resourceURL);
...
HttpClientParams.setRedirecting(postURL.getParams(), false);