Browse Source

链接不重复使用

callm 1 year ago
parent
commit
7122124b04
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/com/uas/mes/core/util/HttpUtil.java

+ 2 - 1
src/com/uas/mes/core/util/HttpUtil.java

@@ -539,7 +539,8 @@ public class HttpUtil {
         HttpPost post = new HttpPost(postUrl);
         HttpPost post = new HttpPost(postUrl);
         StringEntity postingString = new StringEntity(formData, HTTP.UTF_8);
         StringEntity postingString = new StringEntity(formData, HTTP.UTF_8);
         post.setEntity(postingString);
         post.setEntity(postingString);
-        post.setHeader("Content-type", "application/json");
+		post.setHeader("Content-type", "application/json");
+		post.setHeader("Connection", "close");
         CloseableHttpResponse response = httpClient.execute(post);
         CloseableHttpResponse response = httpClient.execute(post);
         return Response.getResponse(response);
         return Response.getResponse(response);
     }
     }