private ClientHttpRequestInterceptor interceptor() {
return new ClientHttpRequestInterceptor() {
@Override
public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)
throws IOException {
LogUtil.debug(log, Boolean.TRUE, "SENDING REQUEST");
LogUtil.debug(log, Boolean.TRUE, "URI ====> %s", request.getURI());
LogUtil.debug(log, Boolean.TRUE, "METHOD ====> %s", request.getMethod());
LogUtil.debug(log, Boolean.TRUE, "BODY ====> %s", new String(body, StandardCharsets.UTF_8));
LogUtil.debug(log, Boolean.TRUE, "HEADERS ====> %s", request.getHeaders());
return execution.execute(request, body);
}
};
}