Package org.springframework.http.client
Class InterceptingClientHttpRequestFactory
java.lang.Object
org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper
org.springframework.http.client.InterceptingClientHttpRequestFactory
- All Implemented Interfaces:
ClientHttpRequestFactory
ClientHttpRequestFactory
wrapper with support for
ClientHttpRequestInterceptors
.- Since:
- 3.1
- Author:
- Arjen Poutsma
- See Also:
-
Constructor Summary
ConstructorDescriptionInterceptingClientHttpRequestFactory
(ClientHttpRequestFactory requestFactory, List<ClientHttpRequestInterceptor> interceptors) Create a new instance of theInterceptingClientHttpRequestFactory
with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientHttpRequest
createRequest
(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) Create a newClientHttpRequest
for the specified URI and HTTP method by using the passed-on request factory.Methods inherited from class org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper
createRequest
-
Constructor Details
-
InterceptingClientHttpRequestFactory
public InterceptingClientHttpRequestFactory(ClientHttpRequestFactory requestFactory, @Nullable List<ClientHttpRequestInterceptor> interceptors) Create a new instance of theInterceptingClientHttpRequestFactory
with the given parameters.- Parameters:
requestFactory
- the request factory to wrapinterceptors
- the interceptors that are to be applied (can benull
)
-
-
Method Details
-
createRequest
protected ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) Description copied from class:AbstractClientHttpRequestFactoryWrapper
Create a newClientHttpRequest
for the specified URI and HTTP method by using the passed-on request factory.Called from
AbstractClientHttpRequestFactoryWrapper.createRequest(URI, HttpMethod)
.- Specified by:
createRequest
in classAbstractClientHttpRequestFactoryWrapper
- Parameters:
uri
- the URI to create a request forhttpMethod
- the HTTP method to executerequestFactory
- the wrapped request factory- Returns:
- the created request
-