|
@@ -73,7 +73,7 @@ public class WeixinUtil {
|
|
* sun.net.www.protocol.http.HttpURLConnection cannot be cast to
|
|
* sun.net.www.protocol.http.HttpURLConnection cannot be cast to
|
|
* javax.net.ssl.HttpsURLConnection
|
|
* javax.net.ssl.HttpsURLConnection
|
|
*/
|
|
*/
|
|
- public static JSONObject httpRequest(String requestUrl,
|
|
|
|
|
|
+ public static JSONObject httpRequest(String requestUrl,
|
|
String requestMethod, String outputStr) {
|
|
String requestMethod, String outputStr) {
|
|
JSONObject jsonObject = null;
|
|
JSONObject jsonObject = null;
|
|
StringBuffer buffer = new StringBuffer();
|
|
StringBuffer buffer = new StringBuffer();
|
|
@@ -116,6 +116,7 @@ public class WeixinUtil {
|
|
while ((str = bufferedReader.readLine()) != null) {
|
|
while ((str = bufferedReader.readLine()) != null) {
|
|
buffer.append(str);
|
|
buffer.append(str);
|
|
}
|
|
}
|
|
|
|
+
|
|
bufferedReader.close();
|
|
bufferedReader.close();
|
|
inputStreamReader.close();
|
|
inputStreamReader.close();
|
|
// 释放资源
|
|
// 释放资源
|
|
@@ -126,6 +127,8 @@ public class WeixinUtil {
|
|
} catch (ConnectException ce) {
|
|
} catch (ConnectException ce) {
|
|
Logger.getAnonymousLogger().info("Weixin server connection timed out.");
|
|
Logger.getAnonymousLogger().info("Weixin server connection timed out.");
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
+ logger.info("信任管理器请求时...");
|
|
|
|
+ e.printStackTrace();
|
|
Logger.getAnonymousLogger().info("信任管理器请求时..." + e);
|
|
Logger.getAnonymousLogger().info("信任管理器请求时..." + e);
|
|
Logger.getAnonymousLogger().info("jsonObject..." + jsonObject);
|
|
Logger.getAnonymousLogger().info("jsonObject..." + jsonObject);
|
|
}
|
|
}
|