public enum HttpProtocol extends Enum<HttpProtocol>
Enum Constant and Description |
---|
H2
HTTP 2.0 support with TLS
|
H2C
HTTP 2.0 support with clear-text.
|
HTTP11
The default supported HTTP protocol by HttpServer and HttpClient
|
Modifier and Type | Method and Description |
---|---|
static HttpProtocol |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HttpProtocol[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HttpProtocol HTTP11
public static final HttpProtocol H2
public static final HttpProtocol H2C
If used along with HTTP1 protocol, will support H2c "upgrade": Request or consume requests as HTTP 1.1 first, looking for HTTP 2.0 headers and Connection: Upgrade. A server will typically reply a successful 101 status if upgrade is successful or a fallback http 1.1 response. When successful the client will start sending HTTP 2.0 traffic.
If used without HTTP1 protocol, will support H2c "prior-knowledge": Doesn't require Connection: Upgrade handshake between a client and server but fallback to HTTP 1.1 will not be supported.
public static HttpProtocol[] values()
for (HttpProtocol c : HttpProtocol.values()) System.out.println(c);
public static HttpProtocol valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null