Prechádzať zdrojové kódy

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

Gizmo 1 rok pred
rodič
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);