- All Superinterfaces:
HttpClient<HttpClientRequest>
,ReleasableResource
,RuntimeType.Api<WebClientConfig>
- All Known Implementing Classes:
DirectWebClient
HTTP client.
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebClientConfig.Builder
builder()
Create a new builder of the HTTP protocol, that can be used with any supported version.<T,
C extends ProtocolConfig>
TTo switch to a non-HTTP protocol client (or a client of a specific HTTP version) using its config configured when creating the client, or default config if none configured.<T,
C extends ProtocolConfig>
TTo switch to a non-HTTP protocol client (or a client of a specific HTTP version).Cookie manager to use by this client.static WebClient
create()
Create a new web client with default configuration.static WebClient
create
(WebClientConfig config) Create a new webclient with customized configuration.static WebClient
create
(Consumer<WebClientConfig.Builder> consumer) Create a new webclient, customizing its configuration.executor()
Executor services, uses virtual threads.Methods inherited from interface io.helidon.webclient.api.HttpClient
closeResource, delete, delete, get, get, head, head, method, options, options, patch, patch, post, post, put, put, trace, trace
Methods inherited from interface io.helidon.webclient.api.ReleasableResource
releaseResource
Methods inherited from interface io.helidon.builder.api.RuntimeType.Api
prototype
-
Method Details
-
builder
Create a new builder of the HTTP protocol, that can be used with any supported version. Which versions are supported is determined by the classpath, HTTP/1.1 is always supported. To support a specific HTTP version only, you can useWebClientConfig.BuilderBase.addProtocolPreference(java.util.List)
.- Returns:
- new HTTP client builder
-
create
Create a new web client with default configuration.- Returns:
- a new web client
-
create
Create a new webclient with customized configuration.- Parameters:
config
- configuration to use- Returns:
- a new web client
-
create
Create a new webclient, customizing its configuration.- Parameters:
consumer
- configuration consumer- Returns:
- a new web client
-
client
To switch to a non-HTTP protocol client (or a client of a specific HTTP version). The resulting protocol will use this client as a base, so it will share all configuration that is relevant for the protocol.- Type Parameters:
T
- type of the protocol clientC
- type of the protocol config- Parameters:
protocol
- protocol instance, usually defined as a constant on the protocol interfaceprotocolConfig
- configuration of the protocol to be used (if customization is required)- Returns:
- a new protocol client instance
-
client
To switch to a non-HTTP protocol client (or a client of a specific HTTP version) using its config configured when creating the client, or default config if none configured. The resulting protocol will use this client as a base, so it will share all configuration that is relevant for the protocol.- Type Parameters:
T
- type of the protocol clientC
- type of the protocol config- Parameters:
protocol
- protocol instance, usually defined as a constant on the protocol interface- Returns:
- a new protocol client instance
-
executor
ExecutorService executor()Executor services, uses virtual threads.- Returns:
- executor service
-
cookieManager
WebClientCookieManager cookieManager()Cookie manager to use by this client.- Returns:
- cookie manager
-