yujian
2019-08-22 33bfa1b3d03236922cc95b9435d7d10c91e8c4e5
utils/src/main/java/org/yeshi/utils/HttpUtil.java
@@ -321,6 +321,22 @@
      return null;
   }
   public static String postSimple(String url) {
      HttpClient client = new HttpClient();
      PostMethod method = new PostMethod(url);
      try {
         client.executeMethod(method);
         return method.getResponseBodyAsString();
      } catch (HttpException e) {
         e.printStackTrace();
      } catch (IOException e) {
         e.printStackTrace();
      }
      return "";
   }
   public static String post(String url) {
      HttpClient client = new HttpClient();
      PostMethod method = new PostMethod(url);
@@ -397,7 +413,7 @@
   public static String post(String url, Map<String, String> map, Map<String, String> headers) {
      HttpClient client = new HttpClient();
      // client.getHostConfiguration().setProxy("192.168.1.122", 8888);
//       client.getHostConfiguration().setProxy("192.168.1.122", 8888);
      PostMethod pm = new PostMethod(url);// 创建HttpPost对象
      NameValuePair[] ns = new NameValuePair[map.keySet().size()];
      Iterator<String> its = map.keySet().iterator();