我正在试图弄清楚我被引导到哪个网址。我正在使用以下代码,它似乎隐藏了重定向。
HttpPost httpPost = new HttpPost(url);
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httpPost);
谢谢, 埃里克
答案 0 :(得分:2)
HttpClient会自动跟踪重定向。我知道要知道重定向的唯一方法是引入RedirectHandler,如前面的SO条目中所讨论的那样:Preventing HttpClient 4 from following redirect。