类 HttpComponentsHttpAsyncClientBuilder
java.lang.Object
org.springframework.boot.http.client.HttpComponentsHttpAsyncClientBuilder
Builder that can be used to create a
Apache HttpComponents
HttpAsyncClient.- 从以下版本开始:
- 3.5.0
- 作者:
- Phillip Webb, Andy Wilkinson, Scott Frederick
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClientbuild(HttpClientSettings settings) Build a newHttpAsyncClientinstance with the given settings applied.withConnectionConfigCustomizer(Consumer<org.apache.hc.client5.http.config.ConnectionConfig.Builder> connectionConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingConnectionConfig.Builder.withConnectionManagerCustomizer(Consumer<org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingPoolingAsyncClientConnectionManagerBuilder.withCustomizer(Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> customizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingHttpAsyncClientBuilder.withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingRequestConfig.Builderused for default requests.withTlsStrategyFactory(Function<SslBundle, org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyFactory) Return a newHttpComponentsHttpAsyncClientBuilderwith a replacementTlsStrategyfactory.
-
构造器详细资料
-
HttpComponentsHttpAsyncClientBuilder
public HttpComponentsHttpAsyncClientBuilder()
-
-
方法详细资料
-
withCustomizer
public HttpComponentsHttpAsyncClientBuilder withCustomizer(Consumer<org.apache.hc.client5.http.impl.async.HttpAsyncClientBuilder> customizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingHttpAsyncClientBuilder.- 参数:
customizer- the customizer to apply- 返回:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withConnectionManagerCustomizer
public HttpComponentsHttpAsyncClientBuilder withConnectionManagerCustomizer(Consumer<org.apache.hc.client5.http.impl.nio.PoolingAsyncClientConnectionManagerBuilder> connectionManagerCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingPoolingAsyncClientConnectionManagerBuilder.- 参数:
connectionManagerCustomizer- the customizer to apply- 返回:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withConnectionConfigCustomizer
public HttpComponentsHttpAsyncClientBuilder withConnectionConfigCustomizer(Consumer<org.apache.hc.client5.http.config.ConnectionConfig.Builder> connectionConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingConnectionConfig.Builder.- 参数:
connectionConfigCustomizer- the customizer to apply- 返回:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withTlsStrategyFactory
public HttpComponentsHttpAsyncClientBuilder withTlsStrategyFactory(Function<SslBundle, org.apache.hc.core5.http.nio.ssl.TlsStrategy> tlsStrategyFactory) Return a newHttpComponentsHttpAsyncClientBuilderwith a replacementTlsStrategyfactory.- 参数:
tlsStrategyFactory- the new factory used to create aTlsStrategyfor a givenSslBundle- 返回:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
withDefaultRequestConfigCustomizer
public HttpComponentsHttpAsyncClientBuilder withDefaultRequestConfigCustomizer(Consumer<org.apache.hc.client5.http.config.RequestConfig.Builder> defaultRequestConfigCustomizer) Return a newHttpComponentsHttpAsyncClientBuilderthat applies additional customization to the underlyingRequestConfig.Builderused for default requests.- 参数:
defaultRequestConfigCustomizer- the customizer to apply- 返回:
- a new
HttpComponentsHttpAsyncClientBuilderinstance
-
build
public org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient build(HttpClientSettings settings) Build a newHttpAsyncClientinstance with the given settings applied.- 参数:
settings- the settings to apply- 返回:
- a new
CloseableHttpAsyncClientinstance
-