我怎样才能获得一个网址HTT presponse [英] How can I get the URL of an HTTPResponse

查看:88
本文介绍了我怎样才能获得一个网址HTT presponse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能得到的HTT presponse的网址是什么? 我想:

  response.getHeaders(位置)
 

但我得到的:

  11-15 21:14:03.355:信息/的System.out(880):[Lorg.apache.http.Header; @ 43ea9568
 

解决方案

您也许被重定向客户端在这种情况下,你要设置一个新的URL思维位置没有位置

请求有网址,响应被发送回​​客户端仅仅是数据包。

how can I get the URL of an HTTPResponse? I tried:

response.getHeaders("Locations")

But I obtained:

11-15 21:14:03.355: INFO/System.out(880): [Lorg.apache.http.Header;@43ea9568

解决方案

You maybe be thinking of redirecting the client to a new url in which case you want to set Location not Locations

Requests have URLs, responses are just data packets sent back to the client.

这篇关于我怎样才能获得一个网址HTT presponse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆