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,790
  • 1
  • 32
  • 37

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
  • 954,112
  • 185
  • 2,315
  • 2,367