feat:请求头日志添加
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.xiang.xservice.basic.utils;
|
package com.xiang.xservice.basic.utils;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.MapUtils;
|
import org.apache.commons.collections4.MapUtils;
|
||||||
import org.apache.http.client.config.RequestConfig;
|
import org.apache.http.client.config.RequestConfig;
|
||||||
@@ -60,7 +61,7 @@ public class HttpUtils {
|
|||||||
CloseableHttpResponse response = null;
|
CloseableHttpResponse response = null;
|
||||||
String result = "";
|
String result = "";
|
||||||
try {
|
try {
|
||||||
log.info("HTTP请求,请求地址===>{}, 请求参数===>{}", url, jsonParams);
|
log.info("HTTP请求,请求地址===>{}, 请求头===>{}, 请求参数===>{}", url, JSON.toJSONString(header), jsonParams);
|
||||||
HttpPost httpPost = new HttpPost(url);
|
HttpPost httpPost = new HttpPost(url);
|
||||||
httpPost.addHeader("Content-Type", "application/json");
|
httpPost.addHeader("Content-Type", "application/json");
|
||||||
// 创建请求内容
|
// 创建请求内容
|
||||||
|
|||||||
Reference in New Issue
Block a user