From 9a9cd31dfba105c069613d8b5d046c40d9644957 Mon Sep 17 00:00:00 2001 From: jiangjiazhi Date: Mon, 27 Nov 2017 11:04:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AE=BE=E7=BD=AE=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/platform/operate/web/utils/HttpClientUtil.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java index 0cac362..fe4b369 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HttpClientUtil.java @@ -61,7 +61,9 @@ public class HttpClientUtil { String result = null; try{ httpClient = new SSLClient(); + httpPost = new HttpPost(url); + httpPost.setConfig(requestConfig); //设置参数 List list = new ArrayList(); Iterator iterator = map.entrySet().iterator(); @@ -94,7 +96,7 @@ public class HttpClientUtil { try{ httpClient = new SSLClient(); httpPost = new HttpPost(url); - + httpPost.setConfig(requestConfig); StringEntity stringEntity = new StringEntity(json.toString(),charset); httpPost.setEntity(stringEntity); stringEntity.setContentEncoding("UTF-8"); @@ -180,7 +182,7 @@ public class HttpClientUtil { DefaultHttpClient client = new DefaultHttpClient( new PoolingClientConnectionManager()); HttpPost httpPost = new HttpPost(url); - + httpPost.setConfig(requestConfig); httpPost.setHeader("Content-Type", "application/json;charset=UTF-8"); StringEntity se = new StringEntity(JSONstr); se.setContentType(CONTENT_TYPE_TEXT_JSON); @@ -192,13 +194,9 @@ public class HttpClientUtil { String STR = EntityUtils.toString(entity, "UTF-8"); JSONObject json2=new JSONObject(); json1=json2.parseObject(STR); - - - }catch (Exception e){ e.printStackTrace(); } return json1; } - } \ No newline at end of file -- 1.8.3.1