记得上下班打卡 | git大法好,push需谨慎

Commit 778ec962 authored by anjiabin's avatar anjiabin

修改http请求header

parent d401176a
......@@ -104,8 +104,8 @@ public class HttpUtil {
public static String postJson(String url, String jsonStr, MultiValueMap<String, String> headers) {
MultiValueMap<String, String> commonHeader = CollectionUtil.linkedMultiValueMapStringString();
headers.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
headers.add("Accept", MediaType.APPLICATION_JSON_UTF8_VALUE);
commonHeader.add("Content-Type", MediaType.APPLICATION_JSON_UTF8_VALUE);
commonHeader.add("Accept", MediaType.APPLICATION_JSON_UTF8_VALUE);
if (url == null || url.trim().isEmpty()) {
return null;
......@@ -119,8 +119,7 @@ public class HttpUtil {
if (headers != null) {
httpHeaders.addAll(headers);
}
System.out.println("httpHeaders:"+JsonUtils.toJson(httpHeaders));
System.out.println("httpHeaders.size:"+JsonUtils.toJson(httpHeaders).length());
HttpEntity<Object> httpEntity = new HttpEntity(jsonStr, httpHeaders);
// 提交方式:表单、json
......
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