@FunctionalInterface interface ClientHttpRequestInterceptor
Intercepts client-side HTTP requests. Implementations of this interface can be registered with the org.springframework.web.client.RestTemplate, as to modify the outgoing ClientHttpRequest and/or the incoming ClientHttpResponse.
The main entry point for interceptors is #intercept(HttpRequest, byte[], ClientHttpRequestExecution)
.
Author
Arjen Poutsma
Since
3.1
abstract fun intercept(request: HttpRequest, body: ByteArray, execution: ClientHttpRequestExecution): ClientHttpResponse
Intercept the given request, and return a response. The given ClientHttpRequestExecution allows the interceptor to pass on the request and response to the next entity in the chain. A typical implementation of this method would follow the following pattern:
|
open class BasicAuthorizationInterceptor : ClientHttpRequestInterceptor
ClientHttpRequestInterceptor to apply a BASIC authorization header. |