Package org.springframework.http.client

# Class InterceptingClientHttpRequestFactory

java.lang.Object
org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper
org.springframework.http.client.InterceptingClientHttpRequestFactory

All Implemented Interfaces:
  `ClientHttpRequestFactory`

public class InterceptingClientHttpRequestFactory extends AbstractClientHttpRequestFactoryWrapper
`ClientHttpRequestFactory` wrapper with support for `ClientHttpRequestInterceptors`.

Since:
  3.1
Author:
  Arjen Poutsma
See Also:
  - `ClientHttpRequestFactory`
  - `ClientHttpRequestInterceptor`

## Constructor Summary

Constructors
Constructor
Description
`InterceptingClientHttpRequestFactory(ClientHttpRequestFactory requestFactory, List<ClientHttpRequestInterceptor> interceptors)`
Create a new instance of the `InterceptingClientHttpRequestFactory` with the given parameters.

## Method Summary

Modifier and Type
Method
Description
`protected ClientHttpRequest`
`createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory)`
Create a new `ClientHttpRequest` for the specified URI and HTTP method by using the passed-on request factory.

### Methods inherited from class org.springframework.http.client.AbstractClientHttpRequestFactoryWrapper

`createRequest, getDelegate`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### InterceptingClientHttpRequestFactory

public InterceptingClientHttpRequestFactory(ClientHttpRequestFactory requestFactory, @Nullable List<ClientHttpRequestInterceptor> interceptors)
Create a new instance of the `InterceptingClientHttpRequestFactory` with the given parameters.

Parameters:
  `requestFactory` - the request factory to wrap
  `interceptors` - the interceptors that are to be applied (can be `null`)

## Method Details

### createRequest

protected ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod, ClientHttpRequestFactory requestFactory)
Description copied from class: `AbstractClientHttpRequestFactoryWrapper`
Create a new `ClientHttpRequest` for the specified URI and HTTP method by using the passed-on request factory.

Called from `AbstractClientHttpRequestFactoryWrapper.createRequest(URI, HttpMethod)`.

Specified by:
  `createRequest` in class `AbstractClientHttpRequestFactoryWrapper`
Parameters:
  `uri` - the URI to create a request for
  `httpMethod` - the HTTP method to execute
  `requestFactory` - the wrapped request factory
Returns:
  the created request