How do I print/Log the request body of JSON from below code @ Rest WS with Jersey in Java. I can log the response for this. I am struggling to log/print the exact request body.
Thanks in advance.
WebTarget target = client.target(url);
//authentication strings
String authString = "username:password";
byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
String authStringEnc = new String(authEncBytes);
Response res = target.request(MediaType.APPLICATION_JSON)
.header("content-type", "application/json")
.header("Authorization", "Basic " + authStringEnc)
.header("accept", "application/json,text/plain")
.header("X-senderTimestamp", new Timestamp(System.currentTimeMillis()))
.header("X-appCode", "IVR")
.header("X-sessionId", XsessionId)
.post(Entity.entity(getAccountInfoInputBean, MediaType.APPLICATION_JSON));