HttpVersionpublic final class HttpVersion extends ProtocolVersion implements SerializableRepresents an HTTP version, as specified in RFC 2616. |
Fields Summary |
---|
private static final long | serialVersionUID | public static final String | HTTPThe protocol name. | public static final HttpVersion | HTTP_0_9HTTP protocol version 0.9 | public static final HttpVersion | HTTP_1_0HTTP protocol version 1.0 | public static final HttpVersion | HTTP_1_1HTTP protocol version 1.1 |
Constructors Summary |
---|
public HttpVersion(int major, int minor)Create an HTTP protocol version designator.
super(HTTP, major, minor);
|
Methods Summary |
---|
public org.apache.http.ProtocolVersion | forVersion(int major, int minor)Obtains a specific HTTP version.
if ((major == this.major) && (minor == this.minor)) {
return this;
}
if (major == 1) {
if (minor == 0) {
return HTTP_1_0;
}
if (minor == 1) {
return HTTP_1_1;
}
}
if ((major == 0) && (minor == 9)) {
return HTTP_0_9;
}
// argument checking is done in the constructor
return new HttpVersion(major, minor);
|
|