开发者

How can I get the URL of an HTTPResponse

开发者 https://www.devze.com 2023-01-25 00:44 出处:网络
how can I get the UR开发者_JS百科L of an HTTPResponse? I tried: response.getHeaders(\"Locations\")

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

精彩评论

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