I see on class "ParseResponse" at method "getResponseAsString".
It will be made a bug when convert data respond to UTF-8 String.
My environment is CentOS 6, Tomcat 9, Java 8.
And I changed it such as below then it's resolved
Thanks!
private String getResponseAsString(HttpResponse httpResponse) {
String jsonText = null;
try {
HttpEntity entity = httpResponse.getEntity();
jsonText = EntityUtils.toString(entity, HTTP.UTF_8);
} catch (org.apache.http.ParseException e) {
LOGGER.error("Error while reading response entity", e);
throw new IllegalArgumentException("Failed getting Parse Response", e);
} catch (IOException e) {
LOGGER.error("Error while reading response entity", e);
throw new IllegalArgumentException("Failed getting Parse Response", e);
}
return jsonText;
/*
try {
BufferedReader r = new BufferedReader(new InputStreamReader(httpResponse.getEntity().getContent()));
StringBuilder total = new StringBuilder();
String line = null;
while ((line = r.readLine()) != null) {
total.append(line);
}
//r.close();
return total.toString();
}
catch(IOException e) {
LOGGER.error("Error while reading response entity", e);
throw new IllegalArgumentException("Failed getting Parse Response", e);
}
*/
}
I see on class "ParseResponse" at method "getResponseAsString". It will be made a bug when convert data respond to UTF-8 String. My environment is CentOS 6, Tomcat 9, Java 8. And I changed it such as below then it's resolved Thanks!