Commit 8e50777e authored by 张永's avatar 张永

ZY

parent 9c04b9f4
......@@ -154,6 +154,7 @@ public class HttpUtil {
connection.setRequestProperty("Content-Length", String.valueOf(bytes.length));
if (headers != null) {
for (String key : headers.keySet()) {
System.out.println(key+"----"+headers.get(key));
connection.setRequestProperty(key, headers.get(key));
}
}
......
......@@ -245,6 +245,12 @@ public class HttpsUtil {
return result;
}
public static String doPostForJson(String url, String json,Map<String,String> headers) {
String result = HttpUtil.post(url, json, headers,null);
return result;
}
/**
* 模拟form表单的形式 ,上传文件 以输出流的形式把文件写入到url中,然后用输入流来获取url的响应
......
......@@ -1163,5 +1163,9 @@ public class StringUtil {
}
return object.toString();
}
public static boolean equals(String str1, String str2) {
return str1 == null ? str2 == null : str1.equals(str2);
}
}
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