Interface HttpOption<T>
- Type Parameters:
T- The type of the option value
HttpClient implementation.
Request configuration option hints can be provided to an
HttpRequest with the HttpRequest.Builder
setOption method.
Concrete instances of this class and its subclasses are immutable.
- API Note:
- In this version, the
HttpOptioninterface is sealed and only allows theH3_DISCOVERYoption. However, it could be extended in the future to support additional options.The
H3_DISCOVERYoption can be used to help theHttpClientdecide how to select or establish an HTTP/3 connection through which to carry out an HTTP/3 request/response exchange. - Since:
- 26
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThis enumeration can be used to help theHttpClientdecide how an HTTP/3 exchange should be established, and can be provided as the value of theH3_DISCOVERYoption toBuilder.setOption. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HttpOption<HttpOption.Http3DiscoveryMode> An option that can be used to configure how theHttpClientwill select or establish an HTTP/3 connection through which to carry out the request. -
Method Summary
-
Field Details
-
H3_DISCOVERY
An option that can be used to configure how theHttpClientwill select or establish an HTTP/3 connection through which to carry out the request. IfHttpClient.Version.HTTP_3is not selected either as the request preferred version or the HttpClient preferred version setting this option on the request has no effect.The name of this option is
"H3_DISCOVERY".- Implementation Note:
- The JDK built-in implementation of the
HttpClientunderstands the request optionH3_DISCOVERYhint.
If noH3_DISCOVERYhint is provided, and the HTTP/3 version is selected, either as request preferred version or client preferred version, the JDK built-in implementation will establish the exchange as perHttpOption.Http3DiscoveryMode.ANY.In case of redirect, the
H3_DISCOVERYoption, if present, is always transferred to the new request.In this implementation, HTTP/3 through proxies is not supported. Unless
HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLYis specified, if a proxy is selected for the request URI, the protocol version is downgraded to HTTP/2 or HTTP/1.1 and theH3_DISCOVERYoption is ignored. If, on the other hand,HttpOption.Http3DiscoveryMode.HTTP_3_URI_ONLYis specified, the request will fail. - See Also:
-
-
Method Details
-
name
String name()Returns the option name.- Implementation Requirements:
- Different options must have different names.
- Returns:
- the option name
-
type
-