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());
}
精彩评论