Reputation: 99
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
Upvotes: 2
Views: 25189
Reputation: 271
Try this
for(Header header : response.getHeaders("Location")) {
System.out.println("Location from connect:" + header.getValue());
}
Upvotes: 2
Reputation: 26756
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.
Upvotes: 2