开发者

How can I get the URL of an HTTPResponse

how can I get the UR开发者_JS百科L 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.


Try this

for(Header header : response.getHeaders("Location")) {
  System.out.println("Location from connect:" + header.getValue());
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜