Class ClientHttpRequestFactories
java.lang.Object
org.springframework.boot.web.client.ClientHttpRequestFactories
Utility class that can be used to create
ClientHttpRequestFactory
instances
configured using given ClientHttpRequestFactorySettings
.- Since:
- 3.0.0
- Author:
- Andy Wilkinson, Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ClientHttpRequestFactory>
Tget
(Class<T> requestFactoryType, ClientHttpRequestFactorySettings settings) Return a newClientHttpRequestFactory
of the given type, applyingClientHttpRequestFactorySettings
using reflection if necessary.static <T extends ClientHttpRequestFactory>
Tget
(Supplier<T> requestFactorySupplier, ClientHttpRequestFactorySettings settings) Return a newClientHttpRequestFactory
from the given supplier, applyingClientHttpRequestFactorySettings
using reflection.static ClientHttpRequestFactory
get
(ClientHttpRequestFactorySettings settings) Return a newClientHttpRequestFactory
instance using the most appropriate implementation.
-
Method Details
-
get
Return a newClientHttpRequestFactory
instance using the most appropriate implementation.- Parameters:
settings
- the settings to apply- Returns:
- a new
ClientHttpRequestFactory
-
get
public static <T extends ClientHttpRequestFactory> T get(Class<T> requestFactoryType, ClientHttpRequestFactorySettings settings) Return a newClientHttpRequestFactory
of the given type, applyingClientHttpRequestFactorySettings
using reflection if necessary.- Type Parameters:
T
- theClientHttpRequestFactory
type- Parameters:
requestFactoryType
- theClientHttpRequestFactory
typesettings
- the settings to apply- Returns:
- a new
ClientHttpRequestFactory
instance
-
get
public static <T extends ClientHttpRequestFactory> T get(Supplier<T> requestFactorySupplier, ClientHttpRequestFactorySettings settings) Return a newClientHttpRequestFactory
from the given supplier, applyingClientHttpRequestFactorySettings
using reflection.- Type Parameters:
T
- theClientHttpRequestFactory
type- Parameters:
requestFactorySupplier
- theClientHttpRequestFactory
suppliersettings
- the settings to apply- Returns:
- a new
ClientHttpRequestFactory
instance
-