Commit 9e6250b9 authored by Quxl's avatar Quxl

x

parent 2b16a97d
...@@ -80,9 +80,6 @@ public class HttpUtil { ...@@ -80,9 +80,6 @@ public class HttpUtil {
try { try {
String requestBody = toQueryString(parameters); String requestBody = toQueryString(parameters);
requestUrl += (requestUrl.contains("?") ? "&" : "?") + requestBody; requestUrl += (requestUrl.contains("?") ? "&" : "?") + requestBody;
System.out.println(requestUrl);
System.out.println(JSON.toJSONString(parameters));
System.out.println(JSON.toJSONString(headers));
URL getUrl = new URL(requestUrl); URL getUrl = new URL(requestUrl);
connection = (HttpURLConnection) getUrl.openConnection(); connection = (HttpURLConnection) getUrl.openConnection();
connection.setRequestMethod("POST"); connection.setRequestMethod("POST");
...@@ -107,9 +104,6 @@ public class HttpUtil { ...@@ -107,9 +104,6 @@ public class HttpUtil {
HttpURLConnection connection = null; HttpURLConnection connection = null;
OutputStream os = null; OutputStream os = null;
try { try {
System.out.println(requestUrl);
System.out.println(JSON.toJSONString(parameters));
System.out.println(JSON.toJSONString(headers));
URL getUrl = new URL(requestUrl); URL getUrl = new URL(requestUrl);
connection = (HttpURLConnection) getUrl.openConnection(); connection = (HttpURLConnection) getUrl.openConnection();
connection.setRequestMethod("POST"); connection.setRequestMethod("POST");
...@@ -120,6 +114,7 @@ public class HttpUtil { ...@@ -120,6 +114,7 @@ public class HttpUtil {
connection.setRequestProperty(key, headers.get(key)); connection.setRequestProperty(key, headers.get(key));
} }
} }
connection.setDoOutput(true);
connection.connect(); connection.connect();
os = connection.getOutputStream(); os = connection.getOutputStream();
String rawData = JSON.toJSONString(parameters); String rawData = JSON.toJSONString(parameters);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment