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