浏览代码

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

Gizmo 1 年之前
父节点
当前提交
8f51d6d2a4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/main/java/com/warewms/common/utils/HttpRequest.java

+ 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);