HttpClient中文乱码问题排查

可以尝试一下方法解决:

1、

httpPost.setHeader("Content-Type", "application/json; charset=UTF-8");  

2、

httpPost.setEntity(new UrlEncodedFormEntity(nvps,"utf-8"));

3、如果还是不行,可以试下这种

httpPost.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

entity.setContentType(ContentType.APPLICATION_JSON);

参考:

https://chenzhihao.cc/archives/153

https://www.cnblogs.com/yixiu868/p/6637645.html

http://blog.csdn.net/anloan/article/details/50471337

原文地址:https://www.cnblogs.com/EasonJim/p/8386225.html