public final class HttpClientConfig extends ClientTransportConfig<HttpClientConfig>
| Modifier and Type | Method and Description |
|---|---|
String |
baseUrl()
Return the configured base URL to use for this request/response or null.
|
protected void |
bindAddress(Supplier<? extends SocketAddress> bindAddressSupplier) |
int |
channelHash() |
ChannelInitializer<Channel> |
channelInitializer(ConnectionObserver connectionObserver,
SocketAddress remoteAddress,
boolean onServer) |
ChannelOperations.OnSetup |
channelOperationsProvider() |
protected Class<? extends Channel> |
channelType(boolean isDomainSocket) |
ConnectionProvider |
connectionProvider() |
ClientCookieDecoder |
cookieDecoder()
Deprecated.
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
|
ClientCookieEncoder |
cookieEncoder()
Deprecated.
as of 1.1.0. This will be removed in 2.0.0 as Netty 5 supports only strict validation.
|
HttpResponseDecoderSpec |
decoder()
Return the configured HTTP response decoder options or the default.
|
AddressResolverGroup<?> |
defaultAddressResolverGroup()
Provides a global
AddressResolverGroup from HttpResources
that is shared amongst all HTTP clients. |
protected ConnectionObserver |
defaultConnectionObserver() |
protected LoggingHandler |
defaultLoggingHandler() |
protected LoopResources |
defaultLoopResources() |
protected ChannelMetricsRecorder |
defaultMetricsRecorder() |
protected ChannelPipelineConfigurer |
defaultOnChannelInit() |
BiPredicate<HttpClientRequest,HttpClientResponse> |
followRedirectPredicate()
Return the configured follow redirect predicate or null.
|
HttpHeaders |
headers()
Return a copy of the request headers.
|
Http2SettingsSpec |
http2SettingsSpec()
Return the HTTP/2 configuration.
|
Http3SettingsSpec |
http3SettingsSpec()
Return the HTTP/3 configuration.
|
boolean |
isAcceptBrotli()
Return whether Brotli compression is enabled.
|
boolean |
isAcceptGzip()
Return whether GZip compression is enabled.
|
boolean |
isRetryDisabled()
Return true if
retry once is disabled, false otherwise. |
boolean |
isSecure()
Returns true if that
HttpClient secured via SSL transport. |
protected void |
loggingHandler(LoggingHandler loggingHandler) |
HttpMethod |
method()
Return the configured request method.
|
protected void |
metricsRecorder(Supplier<? extends ChannelMetricsRecorder> metricsRecorder) |
HttpProtocol[] |
protocols()
Return the HTTP protocol to support.
|
protected void |
proxyProvider(ProxyProvider proxyProvider) |
protected void |
proxyProviderSupplier(Supplier<ProxyProvider> proxyProviderSupplier) |
BiConsumer<HttpHeaders,HttpClientRequest> |
redirectRequestBiConsumer()
Return the configured redirect request
BiConsumer or null. |
Consumer<HttpClientRequest> |
redirectRequestConsumer()
Return the configured redirect request consumer or null.
|
protected AddressResolverGroup<?> |
resolverInternal() |
Duration |
responseTimeout()
Return the configured response timeout or null.
|
SslProvider |
sslProvider()
Returns the current
SslProvider if that HttpClient secured via SSL
transport or null. |
String |
uri()
Return the configured request uri.
|
Function<String,String> |
uriTagValue()
Returns the configured function that receives the actual uri and returns the uri tag value
that will be used for the metrics with
Metrics.URI tag. |
WebsocketClientSpec |
websocketClientSpec()
Return the configured websocket client configuration.
|
doOnConnect, doOnConnected, doOnDisconnected, eventLoopGroup, getNameResolverProvider, hasProxy, proxyProvider, proxyProviderSupplier, remoteAddress, resolverattributes, bindAddress, channelGroup, connectionFactory, connectionObserver, doOnChannelInit, isPreferNative, loggingHandler, loopResources, metricsRecorder, metricsRecorderInternal, options, updateMap@Nullable public String baseUrl()
public int channelHash()
channelHash in class ClientTransportConfig<HttpClientConfig>public ChannelOperations.OnSetup channelOperationsProvider()
channelOperationsProvider in class TransportConfigpublic ConnectionProvider connectionProvider()
connectionProvider in class ClientTransportConfig<HttpClientConfig>@Deprecated public ClientCookieDecoder cookieDecoder()
ClientCookieDecoder or the default ClientCookieDecoder.STRICT.ClientCookieDecoder or the default ClientCookieDecoder.STRICT@Deprecated public ClientCookieEncoder cookieEncoder()
ClientCookieEncoder or the default ClientCookieEncoder.STRICT.ClientCookieEncoder or the default ClientCookieEncoder.STRICTpublic HttpResponseDecoderSpec decoder()
@Nullable public BiPredicate<HttpClientRequest,HttpClientResponse> followRedirectPredicate()
public HttpHeaders headers()
@Nullable public Http2SettingsSpec http2SettingsSpec()
@Incubating @Nullable public Http3SettingsSpec http3SettingsSpec()
public boolean isAcceptBrotli()
public boolean isAcceptGzip()
public boolean isRetryDisabled()
retry once is disabled, false otherwise.retry once is disabled, false otherwisepublic boolean isSecure()
HttpClient secured via SSL transport.HttpClient secured via SSL transportpublic HttpMethod method()
public HttpProtocol[] protocols()
HttpProtocol.HTTP11.@Nullable public BiConsumer<HttpHeaders,HttpClientRequest> redirectRequestBiConsumer()
BiConsumer or null.BiConsumer or null@Nullable public Consumer<HttpClientRequest> redirectRequestConsumer()
@Nullable public Duration responseTimeout()
@Nullable public SslProvider sslProvider()
SslProvider if that HttpClient secured via SSL
transport or null.SslProvider if that HttpClient secured via SSL
transport or nullpublic String uri()
@Nullable public Function<String,String> uriTagValue()
Metrics.URI tag.Metrics.URI tag@Nullable public WebsocketClientSpec websocketClientSpec()
public ChannelInitializer<Channel> channelInitializer(ConnectionObserver connectionObserver, @Nullable SocketAddress remoteAddress, boolean onServer)
channelInitializer in class TransportConfigpublic AddressResolverGroup<?> defaultAddressResolverGroup()
AddressResolverGroup from HttpResources
that is shared amongst all HTTP clients. AddressResolverGroup uses the global
LoopResources from HttpResources.defaultAddressResolverGroup in class ClientTransportConfig<HttpClientConfig>AddressResolverGroupprotected void bindAddress(Supplier<? extends SocketAddress> bindAddressSupplier)
bindAddress in class TransportConfigprotected Class<? extends Channel> channelType(boolean isDomainSocket)
channelType in class ClientTransportConfig<HttpClientConfig>protected ConnectionObserver defaultConnectionObserver()
defaultConnectionObserver in class ClientTransportConfig<HttpClientConfig>protected LoggingHandler defaultLoggingHandler()
defaultLoggingHandler in class TransportConfigprotected LoopResources defaultLoopResources()
defaultLoopResources in class TransportConfigprotected ChannelMetricsRecorder defaultMetricsRecorder()
defaultMetricsRecorder in class TransportConfigprotected ChannelPipelineConfigurer defaultOnChannelInit()
defaultOnChannelInit in class ClientTransportConfig<HttpClientConfig>protected void loggingHandler(LoggingHandler loggingHandler)
loggingHandler in class TransportConfigprotected void metricsRecorder(@Nullable Supplier<? extends ChannelMetricsRecorder> metricsRecorder)
metricsRecorder in class TransportConfigprotected void proxyProvider(ProxyProvider proxyProvider)
proxyProvider in class ClientTransportConfig<HttpClientConfig>protected void proxyProviderSupplier(Supplier<ProxyProvider> proxyProviderSupplier)
proxyProviderSupplier in class ClientTransportConfig<HttpClientConfig>protected AddressResolverGroup<?> resolverInternal()
resolverInternal in class ClientTransportConfig<HttpClientConfig>