@Contract(threading=IMMUTABLE) public final class HttpVersion extends ProtocolVersion
The version of an HTTP message is indicated by an HTTP-Version field in the first line of the message.
HTTP-Version = "HTTP" "/" 1*DIGIT "." 1*DIGIT
Modifier and Type | Field and Description |
---|---|
static String |
HTTP
The protocol name.
|
static HttpVersion |
HTTP_0_9
HTTP protocol version 0.9
|
static HttpVersion |
HTTP_1_0
HTTP protocol version 1.0
|
static HttpVersion |
HTTP_1_1
HTTP protocol version 1.1
|
major, minor, protocol
Constructor and Description |
---|
HttpVersion(int major,
int minor)
Create an HTTP protocol version designator.
|
Modifier and Type | Method and Description |
---|---|
ProtocolVersion |
forVersion(int major,
int minor)
Obtains a specific HTTP version.
|
clone, compareToVersion, equals, getMajor, getMinor, getProtocol, greaterEquals, hashCode, isComparable, lessEquals, toString
public static final String HTTP
public static final HttpVersion HTTP_0_9
public static final HttpVersion HTTP_1_0
public static final HttpVersion HTTP_1_1
public HttpVersion(int major, int minor)
major
- the major version number of the HTTP protocolminor
- the minor version number of the HTTP protocolIllegalArgumentException
- if either major or minor version number is negativepublic ProtocolVersion forVersion(int major, int minor)
forVersion
in class ProtocolVersion
major
- the major versionminor
- the minor versionHttpVersion
with the argument versionCopyright © 2005–2022 The Apache Software Foundation. All rights reserved.