org.springframework.http.client

## Class AbstractClientHttpRequestFactoryWrapper

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

- All Implemented Interfaces:
    ClientHttpRequestFactory
  Direct Known Subclasses:
    BufferingClientHttpRequestFactory, InterceptingClientHttpRequestFactory

      public abstract class AbstractClientHttpRequestFactoryWrapper
      extends Object
      implements ClientHttpRequestFactory

  Abstract base class for `ClientHttpRequestFactory` implementations that decorate another request factory.
  Since:
    3.1
  Author:
    Arjen Poutsma

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractClientHttpRequestFactoryWrapper(ClientHttpRequestFactory requestFactory)` Creates a `AbstractClientHttpRequestFactoryWrapper` wrapping the given request factory.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientHttpRequest` | `createRequest(URI uri, HttpMethod httpMethod)` This implementation simply calls `createRequest(URI, HttpMethod, ClientHttpRequestFactory)` with the wrapped request factory provided to the constructor.
    `protected abstract 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 java.lang.Object

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

- - ### Constructor Detail

    - #### AbstractClientHttpRequestFactoryWrapper

          protected AbstractClientHttpRequestFactoryWrapper(ClientHttpRequestFactory requestFactory)

      Creates a `AbstractClientHttpRequestFactoryWrapper` wrapping the given request factory.
      Parameters:
        `requestFactory` - the request factory to be wrapped

  - ### Method Detail

    - #### createRequest

          public final ClientHttpRequest createRequest(URI uri,
                                        HttpMethod httpMethod)
                                                throws IOException

      This implementation simply calls `createRequest(URI, HttpMethod, ClientHttpRequestFactory)` with the wrapped request factory provided to the constructor.
      Specified by:
        `createRequest` in interface `ClientHttpRequestFactory`
      Parameters:
        `uri` - the URI to create a request for
        `httpMethod` - the HTTP method to execute
      Returns:
        the created request
      Throws:
        `IOException` - in case of I/O errors

    - #### createRequest

          protected abstract ClientHttpRequest createRequest(URI uri,
                                        HttpMethod httpMethod,
                                        ClientHttpRequestFactory requestFactory)
                                                      throws IOException

      Create a new `ClientHttpRequest` for the specified URI and HTTP method by using the passed-on request factory.

      Called from `createRequest(URI, HttpMethod)`.

      Parameters:
        `uri` - the URI to create a request for
        `httpMethod` - the HTTP method to execute
        `requestFactory` - the wrapped request factory
      Returns:
        the created request
      Throws:
        `IOException` - in case of I/O errors