- All Superinterfaces:
- ReleasableResource
- All Known Implementing Classes:
- Http2ClientImpl
Integration for HTTP versions to provide a single API.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic enumHow does the provider support the request.
- 
Method SummaryModifier and TypeMethodDescriptionclientRequest(FullClientRequest<?> clientRequest, ClientUri clientUri) Create a client request based on the provided HTTP request that is for the version of this client.default booleanisTcp()For TCP based protocols, we can do ALPN negotiation, obtain a connection, and then let the client handle the protocol.supports(FullClientRequest<?> clientRequest, ClientUri clientUri) Return whether this HTTP version can handle the provided request.Methods inherited from interface io.helidon.webclient.api.ReleasableResourcecloseResource, releaseResource
- 
Method Details- 
supportsReturn whether this HTTP version can handle the provided request.Examples: - HTTP/1.1 always returns true, as it is the fallback protocol of all other protocols
- HTTP/2 returns true when upgrade is enabled, false when prior-knowledge is specified (as we can always attempt to upgrade and fallback to 1.1 in the first case, but we would fail with prior-knowledge, unless the endpoint is known to be HTTP/2
- HTTP/3 would always return true, as it cannot fallback once a connection is attempted
 - An explicit protocol id is configured for the request -
     HttpClientRequest.protocolId(String)
- There is no fallback protocol enabled, in such a case, we use the one with highest priority - see
     WebClientConfig.BuilderBase.addProtocolPreference(String)
- We get an Alt-Svcheader from a response that points us to a protocol version (we only support permanent protocol changes,Alt-Svcwith timeout will be ignored
- This protocol version already handled a request to such an endpoint and has the connection available
 - Parameters:
- clientRequest- HTTP request
- clientUri- URI to invoke
- Returns:
- trueif we are sure we can handle this request with this protocol version
 
- 
clientRequestCreate a client request based on the provided HTTP request that is for the version of this client.- Parameters:
- clientRequest- request configuration
- clientUri- URI to invoke (resolved)
- Returns:
- a new request
 
- 
isTcpdefault boolean isTcp()For TCP based protocols, we can do ALPN negotiation, obtain a connection, and then let the client handle the protocol. Similar for proxies - we can establish a proxy connection, and then let the client handle the protocol. For UDP based protocols, we need to wait forAlt-Svcheaders before attempting anything, or have an explicit version configured.- Returns:
- whether this is a TCP based HTTP protocol, defaults to true
 
 
-