Browse Source

refactor: 修改 requestEntity 为具体类型

linwenhua 3 năm trước cách đây
mục cha
commit
3a05519666

+ 2 - 2
src/main/java/com/inspur/smsb/gateway/utils/HttpClientUtil.java

@@ -56,7 +56,7 @@ public class HttpClientUtil {
 
         PostMethod httpPost = new PostMethod(url);
         try {
-            RequestEntity requestEntity = new ByteArrayRequestEntity(params.getBytes("utf-8"));
+            ByteArrayRequestEntity requestEntity = new ByteArrayRequestEntity(params.getBytes("utf-8"));
             httpPost.setRequestEntity(requestEntity);
             if (StringUtils.hasText(type)) {
                 httpPost.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
@@ -126,7 +126,7 @@ public class HttpClientUtil {
         httpput.setRequestHeader("Authorization", "Bearer " + token);
         try {
             if (param != null) {
-                RequestEntity entity = new StringRequestEntity(param, "application/json", "UTF-8");
+                StringRequestEntity entity = new StringRequestEntity(param, "application/json", "UTF-8");
                 httpput.setRequestEntity(entity);
             }
             client.executeMethod(httpput);