chenjiahe
2021-10-15 b82acbfda2e0d8bd5d0e90a2017e57b5f76e8786
src/main/java/com/hx/util/HttpMethodUtil.java
@@ -26,7 +26,6 @@
        HttpURLConnection con = null;
        URL u = null;
        String wxMsgXml = null;
        JSONObject obj = null;
        try {
            StringBuilder dataP = new StringBuilder();
            if (keyValues != null && !keyValues.isEmpty()) {
@@ -63,20 +62,14 @@
                os.write(data.getBytes("utf-8"));
            }
            if (con.getResponseCode() != 200)
            if (con.getResponseCode() != 200){
                throw new RuntimeException("请求url失败");
            }
            // 读取返回内容
            wxMsgXml = IOUtils.toString(con.getInputStream(), "utf-8");
            // //System.out.println("HttpURLUtil:"+wxMsgXml);
        } catch (Exception e) {
            e.printStackTrace();
            obj = new JSONObject();
            try {
                obj.put("status", 1);
                obj.put("errMsg", e.getMessage());
            } catch (JSONException e1) {
                e1.printStackTrace();
            }
        } finally {
            if (con != null) {
                con.disconnect();