| Modifier and Type | Field and Description |
|---|---|
| private static final AsciiString | |
| private static final String | |
| private static final AsciiString |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static String | Returns: the formatted Stringthe address addr)Formats the host string of an address so it can be used for computing an HTTP component such as a URL or a Host header |
| public static Charset | Returns: the charset from message's Content-Type header orStandardCharsets#ISO_8859_1
if charset is not presented or unparsableentity to fetch Content-Type header from message)Fetch charset from message's Content-Type header. |
| public static Charset | Returns: the charset from message's Content-Type header orStandardCharsets#ISO_8859_1
if charset is not presented or unparsableContent-Type header value to parse contentTypeValue)Fetch charset from Content-Type header value. |
| public static Charset | Returns: the charset from message's Content-Type header ordefaultCharset
if charset is not presented or unparsableentity to fetch Content-Type header from message, Charset result to use in case of empty, incorrect or doesn't contain required part header value defaultCharset)Fetch charset from message's Content-Type header. |
| public static Charset | Returns: the charset from message's Content-Type header ordefaultCharset
if charset is not presented or unparsableContent-Type header value to parse contentTypeValue, Charset result to use in case of empty, incorrect or doesn't contain required part header value defaultCharset)Fetch charset from Content-Type header value. |
| public static CharSequence | Returns: theCharSequence with charset from message's Content-Type header
or null if charset is not presentedFetch charset from message's Content-Type header as a char sequence. |
| public static CharSequence | Returns: theCharSequence with charset from message's Content-Type header
or null if charset is not presentedContent-Type header value to parse contentTypeValue)Fetch charset from Content-Type header value as a char sequence. |
| public static CharSequence | Returns: theCharSequence with charset from message's Content-Type header
or null if charset is not presentedentity to fetch Content-Type header from message)
Deprecated
use
Fetch charset from message's Content-Type header as a char sequence.
getCharsetAsSequence(HttpMessage)
|
| public static long | |
| public static long | Returns: the content length or the specified default valuethe message message, long the default value defaultValue)Returns the length of the content or the specified default value if the message does not have the |
| public static int | Returns: the content length ordefaultValue if this message does
not have the "Content-Length" header.Get an |
| public static CharSequence | Returns: the MIME type as aCharSequence from message's Content-Type header
or null if content-type header or MIME type part of this header are not presented
"content-type: text/html; charset=utf-8" - "text/html" will be returned entity to fetch Content-Type header from message)Fetch MIME type part from message's Content-Type header as a char sequence. |
| public static CharSequence | Returns: the MIME type as aCharSequence from message's Content-Type header
or null if content-type header or MIME type part of this header are not presented
"content-type: text/html; charset=utf-8" - "text/html" will be returned Content-Type header value to parse contentTypeValue)Fetch MIME type part from Content-Type header value as a char sequence. |
| public static boolean | Returns: true if and only if the expectation 100-continue is present and it is the only expectation
presentthe message message)Returns |
| public static boolean | |
| public static boolean | |
| public static boolean | |
| private static boolean | |
| public static boolean | isKeepAlive(HttpMessage message)
Returns |
| public static boolean | |
| public static boolean | |
| public static boolean | Returns: True if transfer encoding is chunked, otherwise falseThe message to check message)Checks to see if the transfer encoding in a specified |
| pack-priv static boolean | Returns: true if and only if an expectation is present that is not supportedthe message message)Returns |
| public static long | Returns: the normalized content length from the headers or-1 if the fields were empty.the content-length header fields. contentLengthFields, boolean true if we are handling HTTP/1.0 or earliertrue if multiple, identical-value content lengths should be allowed.Validates, and optionally extracts the content length from headers. |
| public static void | set100ContinueExpected(HttpMessage message, boolean expected)
Sets or removes the |
| public static void | |
| public static void | setKeepAlive(HttpMessage message, boolean keepAlive)
Sets the value of the |
| public static void | setKeepAlive(HttpHeaders h, HttpVersion httpVersion, boolean keepAlive)
Sets the value of the |
| public static void | setTransferEncodingChunked(HttpMessage
The message which contains the headers to modify. m, boolean if chunked)true then include HttpHeaderValues#CHUNKED in the headers. otherwise remove
HttpHeaderValues#CHUNKED from the headers.Set the |
| CHARSET_EQUALS | back to summary |
|---|---|
| private static final AsciiString CHARSET_EQUALS | |
| COMMA_STRING | back to summary |
|---|---|
| private static final String COMMA_STRING | |
| SEMICOLON | back to summary |
|---|---|
| private static final AsciiString SEMICOLON | |
| HttpUtil | back to summary |
|---|---|
| private HttpUtil() | |
| formatHostnameForHttp | back to summary |
|---|---|
| public static String formatHostnameForHttp(InetSocketAddress addr) Formats the host string of an address so it can be used for computing an HTTP component such as a URL or a Host header
| |
| getCharset | back to summary |
|---|---|
| public static Charset getCharset(HttpMessage message) Fetch charset from message's Content-Type header.
| |
| getCharset | back to summary |
|---|---|
| public static Charset getCharset(CharSequence contentTypeValue) Fetch charset from Content-Type header value.
| |
| getCharset | back to summary |
|---|---|
| public static Charset getCharset(HttpMessage message, Charset defaultCharset) Fetch charset from message's Content-Type header.
| |
| getCharset | back to summary |
|---|---|
| public static Charset getCharset(CharSequence contentTypeValue, Charset defaultCharset) Fetch charset from Content-Type header value.
| |
| getCharsetAsSequence | back to summary |
|---|---|
| public static CharSequence getCharsetAsSequence(HttpMessage message) Fetch charset from message's Content-Type header as a char sequence. A lot of sites/possibly clients have charset="CHARSET", for example charset="utf-8". Or "utf8" instead of "utf-8" This is not according to standard, but this method provide an ability to catch desired mistakes manually in code
| |
| getCharsetAsSequence | back to summary |
|---|---|
| public static CharSequence getCharsetAsSequence(CharSequence contentTypeValue) Fetch charset from Content-Type header value as a char sequence. A lot of sites/possibly clients have charset="CHARSET", for example charset="utf-8". Or "utf8" instead of "utf-8" This is not according to standard, but this method provide an ability to catch desired mistakes manually in code
| |
| getCharsetAsString | back to summary |
|---|---|
| public static CharSequence getCharsetAsString(HttpMessage message)
Deprecated Fetch charset from message's Content-Type header as a char sequence. A lot of sites/possibly clients have charset="CHARSET", for example charset="utf-8". Or "utf8" instead of "utf-8" This is not according to standard, but this method provide an ability to catch desired mistakes manually in code
| |
| getContentLength | back to summary |
|---|---|
| public static long getContentLength(HttpMessage message) Returns the length of the content. Please note that this value is
not retrieved from
| |
| getContentLength | back to summary |
|---|---|
| public static long getContentLength(HttpMessage message, long defaultValue) Returns the length of the content or the specified default value if the message does not have the
| |
| getContentLength | back to summary |
|---|---|
| public static int getContentLength(HttpMessage message, int defaultValue) Get an
| |
| getMimeType | back to summary |
|---|---|
| public static CharSequence getMimeType(HttpMessage message) Fetch MIME type part from message's Content-Type header as a char sequence.
| |
| getMimeType | back to summary |
|---|---|
| public static CharSequence getMimeType(CharSequence contentTypeValue) Fetch MIME type part from Content-Type header value as a char sequence.
| |
| is100ContinueExpected | back to summary |
|---|---|
| public static boolean is100ContinueExpected(HttpMessage message) Returns
| |
| isAsteriskForm | back to summary |
|---|---|
| public static boolean isAsteriskForm(URI uri) Determine if a uri is in asterisk-form according to rfc7230, 5.3. | |
| isAsteriskForm | back to summary |
|---|---|
| public static boolean isAsteriskForm(String uri) Determine if a string uri is in asterisk-form according to rfc7230, 5.3. | |
| isContentLengthSet | back to summary |
|---|---|
| public static boolean isContentLengthSet(HttpMessage m) | |
| isExpectHeaderValid | back to summary |
|---|---|
| private static boolean isExpectHeaderValid(final HttpMessage message) | |
| isKeepAlive | back to summary |
|---|---|
| public static boolean isKeepAlive(HttpMessage message) Returns | |
| isOriginForm | back to summary |
|---|---|
| public static boolean isOriginForm(URI uri) Determine if a uri is in origin-form according to rfc7230, 5.3. | |
| isOriginForm | back to summary |
|---|---|
| public static boolean isOriginForm(String uri) Determine if a string uri is in origin-form according to rfc7230, 5.3. | |
| isTransferEncodingChunked | back to summary |
|---|---|
| public static boolean isTransferEncodingChunked(HttpMessage message) Checks to see if the transfer encoding in a specified
| |
| isUnsupportedExpectation | back to summary |
|---|---|
| pack-priv static boolean isUnsupportedExpectation(HttpMessage message) Returns
| |
| normalizeAndGetContentLength | back to summary |
|---|---|
| public static long normalizeAndGetContentLength(Iterator<CharSequence> contentLengthFields, boolean isHttp10OrEarlier, boolean allowDuplicateContentLengths) Validates, and optionally extracts the content length from headers. This method is not intended for general use, but is here to be shared between HTTP/1 and HTTP/2 parsing.
| |
| set100ContinueExpected | back to summary |
|---|---|
| public static void set100ContinueExpected(HttpMessage message, boolean expected) Sets or removes the | |
| setContentLength | back to summary |
|---|---|
| public static void setContentLength(HttpMessage message, long length) Sets the | |
| setKeepAlive | back to summary |
|---|---|
| public static void setKeepAlive(HttpMessage message, boolean keepAlive) Sets the value of the
| |
| setKeepAlive | back to summary |
|---|---|
| public static void setKeepAlive(HttpHeaders h, HttpVersion httpVersion, boolean keepAlive) Sets the value of the
| |
| setTransferEncodingChunked | back to summary |
|---|---|
| public static void setTransferEncodingChunked(HttpMessage m, boolean chunked) Set the
| |