Interface WebClientProvider
Deprecated.
since 5.0
Provider for
Client instances are typically cached allowing reuse of pooled connections if configured on the
WebClients using a pre-configured scheme. This class returns WebClient for a
specific endpoint and encapsulates common configuration aspects of WebClient so
that code using WebClient is not required to apply further configuration to the actual client. Client instances are typically cached allowing reuse of pooled connections if configured on the
ClientHttpConnector.- Since:
- 3.2
- Author:
- Christoph Strobl, Mark Paluch, Huw Ayling-Miller, Peter-Josef Meisch
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebClientProviderDeprecated.static WebClientProvidercreate(String scheme, ClientHttpConnector connector) Deprecated.get(InetSocketAddress endpoint) Deprecated.Obtain theWebClientconfigured withdefault HTTP headersandConsumererror callback for a givenendpoint.Deprecated.Obtain theHttpHeadersto be used by default.Deprecated.Obtain theerror listenerto be used;Deprecated.Obtain thepathPrefixto be used.static WebClientProvidergetWebClientProvider(ClientConfiguration clientConfiguration) Deprecated.Creates aWebClientProviderfor the given configurationstatic WebClientProviderhttp()Deprecated.withDefaultHeaders(HttpHeaders headers) Deprecated.Create a new instance ofWebClientProviderapplying the given headers by default.withErrorListener(Consumer<Throwable> errorListener) Deprecated.Create a new instance ofWebClientProvidercalling the givenConsumeron error.withPathPrefix(String pathPrefix) Deprecated.Create a new instance ofWebClientProviderwhere HTTP requests are called with the given path prefix.withRequestConfigurer(Consumer<WebClient.RequestHeadersSpec<?>> requestConfigurer) Deprecated.Create a new instance ofWebClientProvidercalling the givenConsumerto configure the requests of thisWebClient.withWebClientConfigurer(Function<WebClient, WebClient> webClientConfigurer) Deprecated.
-
Method Details
-
http
Deprecated.- Returns:
- the resulting
WebClientProvider.
-
create
Deprecated.- Parameters:
scheme- protocol scheme such as http or https.- Returns:
- the resulting
WebClientProvider.
-
create
Deprecated.- Parameters:
scheme- protocol scheme such as http or https.connector- the HTTP connector to use. Can be null.- Returns:
- the resulting
WebClientProvider.
-
get
Deprecated.Obtain theWebClientconfigured withdefault HTTP headersandConsumererror callback for a givenendpoint. -
getDefaultHeaders
HttpHeaders getDefaultHeaders()Deprecated.Obtain theHttpHeadersto be used by default.- Returns:
- never null.
HttpHeaders.EMPTYby default.
-
getErrorListener
Deprecated.Obtain theerror listenerto be used;- Returns:
- never null.
-
getPathPrefix
Deprecated.Obtain thepathPrefixto be used.- Returns:
- the pathPrefix if set.
- Since:
- 4.0
-
withDefaultHeaders
Deprecated.Create a new instance ofWebClientProviderapplying the given headers by default.- Parameters:
headers- must not be null.- Returns:
- new instance of
WebClientProvider.
-
withErrorListener
Deprecated.Create a new instance ofWebClientProvidercalling the givenConsumeron error.- Parameters:
errorListener- must not be null.- Returns:
- new instance of
WebClientProvider.
-
withPathPrefix
Deprecated.Create a new instance ofWebClientProviderwhere HTTP requests are called with the given path prefix.- Parameters:
pathPrefix- Path prefix to add to requests- Returns:
- new instance of
WebClientProvider - Since:
- 4.0
-
withWebClientConfigurer
Deprecated.- Parameters:
webClientConfigurer- configuration function- Returns:
- new instance of
WebClientProvider - Since:
- 4.0
-
withRequestConfigurer
WebClientProvider withRequestConfigurer(Consumer<WebClient.RequestHeadersSpec<?>> requestConfigurer) Deprecated.Create a new instance ofWebClientProvidercalling the givenConsumerto configure the requests of thisWebClient.- Parameters:
requestConfigurer- request configuration callback- Returns:
- new instance of
WebClientProvider - Since:
- 4.3
-
getWebClientProvider
Deprecated.Creates aWebClientProviderfor the given configuration- Parameters:
clientConfiguration- must not be null- Returns:
- the
WebClientProvider - Since:
- 4.3
-