From de35a605a763898fc5a1e259a79d34e1248d43a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E7=9A=AE?= <14840170+lao-pi123@user.noreply.gitee.com> Date: Fri, 1 Nov 2024 17:11:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BD=91=E7=BB=9C=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/yunbao/common/http/HttpLoggingInterceptor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/src/main/java/com/yunbao/common/http/HttpLoggingInterceptor.java b/common/src/main/java/com/yunbao/common/http/HttpLoggingInterceptor.java index 74acc0e19..6b730c1f5 100644 --- a/common/src/main/java/com/yunbao/common/http/HttpLoggingInterceptor.java +++ b/common/src/main/java/com/yunbao/common/http/HttpLoggingInterceptor.java @@ -107,6 +107,9 @@ public class HttpLoggingInterceptor implements Interceptor { String name = headers.name(i); // Skip headers from the request body as they are explicitly logged above. if (!"Content-Type".equalsIgnoreCase(name) && !"Content-Length".equalsIgnoreCase(name)) { + if (i == 0){ + log("请求头:"); + } log("\t" + name + ": " + headers.value(i)); } } @@ -114,6 +117,7 @@ public class HttpLoggingInterceptor implements Interceptor { log(" "); if (logBody && hasRequestBody) { if (isPlaintext(requestBody.contentType())) { + log("request Body :"); bodyToString(request); } else { log("\tbody: maybe [binary body], omitted!");