From Java code I want to call a webservice like this:
"http://example.com/mytarget?firstParam=xxx¤cy=EUR"
But no matter what I do. As soon as I compose a String with "¤cy=" in it, it gets replaced by "¤cy="
instantly, which the webservice doesn't like and responds with an error.
To illustrate, here is a small code snipet I use:
String uri = "http://example.com?test=1¤cy=EUR";
HttpGet request = new HttpGet(uri); //string got replaced already!
request.addHeader("content-type", "application/json");
HttpResponse result = httpClient.execute(request);
String json = EntityUtils.toString(result.getEntity(), "UTF-8");
The above code makes a call to:"http://example.com?test=1¤cy=EUR"
Similar Question, no answer: https://stackoverflow.com/questions/29890388/how-to-get-curren-to-display-literally-not-as-an-html-entity-in-Java
Any ideas? Or is there a "proper" way to call a webservice from Java code that avoids this problem?