Ver código fonte

- 接口传参中文乱码问题处理;

Gizmo 1 ano atrás
pai
commit
8f51d6d2a4

+ 1 - 1
src/main/java/com/warewms/common/utils/HttpRequest.java

@@ -114,7 +114,7 @@ public class HttpRequest {
         CloseableHttpClient httpclient = HttpClients.createDefault();
         HttpPost httpPost = new HttpPost(url);
         httpPost.setHeader("Content-Type", "application/json;charset=UTF-8");
-        StringEntity stringEntity = new StringEntity(Json);
+        StringEntity stringEntity = new StringEntity(Json, "UTF-8");
         stringEntity.setContentType("text/json");
         httpPost.setEntity(stringEntity);
         CloseableHttpResponse response = httpclient.execute(httpPost);