public final class ContentLength extends HeaderInteger
The length of the response body in octets (8-bit bytes).
Content-Length: 348
Content-Length = "Content-Length" ":" 1*DIGIT
An example is...
Content-Length: 3495
Applications SHOULD use this field to indicate the transfer-length of the message-body, unless this is prohibited by the rules in section 4.4.
Any Content-Length greater than or equal to zero is a valid value. Section 4.4 describes how to determine the length of a message-body if a Content-Length is not given.
Note that the meaning of this field is significantly different from the corresponding definition in MIME, where it is an optional field used within the "message/external-body" content-type. In HTTP, it SHOULD be sent whenever the message's length can be determined prior to being transferred, unless this is prohibited by the rules in section 4.4.
Modifier and Type | Method and Description |
---|---|
static ContentLength |
forString(String value)
Returns a parsed
Content-Length header. |
asInt, toString
public static ContentLength forString(String value)
Content-Length
header.value
- The Content-Length
header string.Content-Length
header, or Copyright © 2018 Apache. All rights reserved.