I try to trigger an http GET request
It should be as follows:
https://www.my_service.com/myRequest?from=x%3A34.78104114532471+y%3A31.243920719573723&to=x%3A34.77901339530945+y%3A31.242416368424312&
I wrote this code
webResource.accept("application/json");
ClientResponse response = webResource.path("myRequest")
.queryParam("from", "x%3A34.78104114532471+y%3A31.243920719573723")
.queryParam("to", "x%3A34.77901339530945+y%3A31.242416368424312")
.accept(MediaType.APPLICATION_JSON_TYPE)
.get(ClientResponse.class);
if (response.getStatus() != 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatus());
}
which generates this url:
https://www.my_service.com/myRequest?from=x%3A34.78104114532471+y%3A31.243920719573723&to=x%3A34.77901339530945+y%3A31.242416368424312&
but this returns 404 error.
I have tried the two urls in the browser.
The only difference is +
replaced by %2B
+
works for me but %2B
doesn't.
how can i make the code not replace +
with %2B
?