Skip to content

Instantly share code, notes, and snippets.

View marcosarshavin's full-sized avatar

Marcos marcosarshavin

  • Mordor Inc.
  • The shire.
View GitHub Profile
@marcosarshavin
marcosarshavin / LoggingClientHttpRequestInterceptor.java
Last active October 26, 2017 12:41 — forked from jkuipers/LoggingClientHttpRequestInterceptor.java
RestTemplate-interceptor that logs outgoing requests and resulting responses
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRequest;
import org.springframework.http.MediaType;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.util.StreamUtils;