Explorar el Código

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

Gizmo hace 1 año
padre
commit
8f51d6d2a4
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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);