开发者

How do I see which URL I was redirected to?

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 DefaultH开发者_开发问答ttpClient();
HttpResponse response = httpclient.execute(httpPost);

Thanks, Erik


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜