Package org.springframework.http.client
Class InterceptingClientHttpRequestFactory
java.lang.Object
org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper
org.springframework.http.client.InterceptingClientHttpRequestFactory
- All Implemented Interfaces:
Closeable,AutoCloseable,ClientHttpRequestFactory
ClientHttpRequestFactory wrapper with support for
ClientHttpRequestInterceptors.- Since:
- 3.1
- Author:
- Arjen Poutsma
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionInterceptingClientHttpRequestFactory(ClientHttpRequestFactory requestFactory, List<ClientHttpRequestInterceptor> interceptors) Create a new instance of theInterceptingClientHttpRequestFactorywith the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected ClientHttpRequestcreateRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory) Create a newClientHttpRequestfor the specified URI and HTTP method by using the passed-on request factory.Methods inherited from class org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper
createRequestMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.http.client.ClientHttpRequestFactory
close
-
Constructor Details
-
InterceptingClientHttpRequestFactory
public InterceptingClientHttpRequestFactory(ClientHttpRequestFactory requestFactory, @Nullable List<ClientHttpRequestInterceptor> interceptors) Create a new instance of theInterceptingClientHttpRequestFactorywith 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:AbstractClientHttpRequestFactoryWrapperCreate a newClientHttpRequestfor the specified URI and HTTP method by using the passed-on request factory.Called from
AbstractClientHttpRequestFactoryWrapper.createRequest(URI, HttpMethod).- Specified by:
createRequestin classAbstractClientHttpRequestFactoryWrapper- Parameters:
uri- the URI to create a request forhttpMethod- the HTTP method to executerequestFactory- the wrapped request factory- Returns:
- the created request
-