yujian
2019-11-23 a364fbab598a45842d4b38d156e8b5e55f9513ad
utils/src/main/java/org/yeshi/utils/HttpUtil.java
@@ -473,6 +473,24 @@
      }
      return "";
   }
   @SuppressWarnings("deprecation")
   public static String post(String url, String entity,String charset) {
      HttpClient client = new HttpClient();
      PostMethod method = new PostMethod(url);
      method.addRequestHeader("Content-Type", "text/html;charset="+charset);
      method.setRequestHeader("Content-Type", "text/html;charset="+charset);
      method.setRequestBody(entity);
      try {
         client.executeMethod(method);
         return convertInputStreamToString(method.getResponseBodyAsStream());
      } catch (HttpException e) {
         e.printStackTrace();
      } catch (IOException e) {
         e.printStackTrace();
      }
      return "";
   }
   public static String postInputStream(String url, File file) throws FileNotFoundException {
      HttpClient client = new HttpClient();