org.springframework.web.client.RestClient or
org.springframework.web.client.RestTemplate to modify the outgoing
request and/or the incoming response.
| Modifier and Type | Method and Description |
|---|---|
| public ClientHttpResponse | Returns: the responsethe request, containing method, URI, and headers request, byte[] the body of the request body, ClientHttpRequestExecution the request execution execution)Intercept the given request, and return a response. |
| intercept | back to summary |
|---|---|
| public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution) throws IOException Intercept the given request, and return a response. The given
A typical implementation of this method would follow the following pattern:
Note if the interceptor throws an exception after receiving a response,
it must close the response via
| |