1

I'm trying to figure out which URL I was directed to. I'm using the following code and it seems to hide the redirect.

HttpPost httpPost = new HttpPost(url);
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httpPost);

Thanks, Erik

Erik B
  • 2,810
  • 1
  • 34
  • 38

1 Answers1

2

HttpClient automatically follows redirects. The only way I know of to know what redirects are going on is to introduce a RedirectHandler, as is discussed in a previous SO entry: Preventing HttpClient 4 from following redirect.

Community
  • 1
  • 1
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491