From 6ede31251021bee3bd4b462552eb7b79f6abf011 Mon Sep 17 00:00:00 2001 From: HuangXin Date: Wed, 14 Oct 2020 14:16:33 +0800 Subject: [PATCH] =?UTF-8?q?OCT=20REM:=201.=20=E5=A2=9E=E5=8A=A0=E6=B5=A9?= =?UTF-8?q?=E7=80=9A=E6=8E=A5=E5=8F=A3=E8=AF=B7=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/dispose/restful/RestfulInterface.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/dispose/restful/RestfulInterface.java b/src/main/java/com/dispose/restful/RestfulInterface.java index a40e0322..b7cc6f39 100644 --- a/src/main/java/com/dispose/restful/RestfulInterface.java +++ b/src/main/java/com/dispose/restful/RestfulInterface.java @@ -75,13 +75,19 @@ public class RestfulInterface { httpHeadMap.put(String.valueOf(Header.CONNECTION), "keep-alive"); httpHeadMap.put(String.valueOf(Header.ACCEPT), "*/*"); - String svrResp = postJson(url, httpHeadMap, OBJECT_MAPPER.writeValueAsString(obj)); + String reqJson = OBJECT_MAPPER.writeValueAsString(obj); + + log.debug("Restful request: {}: {}", url, reqJson); + + String svrResp = postJson(url, httpHeadMap, reqJson); if (svrResp == null) { log.debug("Server return null: {}", url); return null; } + log.debug("Restful response: {}: {}", url, svrResp); + return OBJECT_MAPPER.readValue(svrResp, outType); } catch (JsonProcessingException e) { log.debug("System exception: ", e); @@ -116,7 +122,7 @@ public class RestfulInterface { String reqJson = OBJECT_MAPPER.writeValueAsString(obj); - log.debug("PengXin request: {}, {}: {}", url, token, reqJson); + log.debug("Restful request: {}, {}: {}", url, token, reqJson); switch (reqType) { case GET: @@ -135,7 +141,7 @@ public class RestfulInterface { return null; } - log.debug("PengXin response: {}, {}: {}", url, token, svrResp); + log.debug("Restful response: {}, {}: {}", url, token, svrResp); return OBJECT_MAPPER.readValue(svrResp, new TypeReference>() {