Class ContentEncoding
- All Implemented Interfaces:
Serializable
,Cloneable
,Header
,NameValuePair
The type of encoding used on the data.
Example
Content-Encoding: gzip
RFC2616 Specification
The Content-Encoding entity-header field is used as a modifier to the media-type. When present, its value indicates what additional content codings have been applied to the entity-body, and thus what decoding mechanisms must be applied in order to obtain the media-type referenced by the Content-Type header field. Content-Encoding is primarily used to allow a document to be compressed without losing the identity of its underlying media type.Content-Encoding = "Content-Encoding" ":" 1#content-coding
Content codings are defined in section 3.5. An example of its use is...
Content-Encoding: gzip
The content-coding is a characteristic of the entity identified by the Request-URI. Typically, the entity-body is stored with this encoding and is only decoded before rendering or analogous usage. However, a non-transparent proxy MAY modify the content-coding if the new coding is known to be acceptable to the recipient, unless the "no-transform" cache-control directive is present in the message.
If the content-coding of an entity is not "identity", then the response MUST include a Content-Encoding entity-header (section 14.11) that lists the non-identity content-coding(s) used.
If the content-coding of an entity in a request message is not acceptable to the origin server, the server SHOULD respond with a status code of 415 (Unsupported Media Type).
If multiple encodings have been applied to an entity, the content codings MUST be listed in the order in which they were applied. Additional information about the encoding parameters MAY be provided.
See Also:
-
Constructor Summary
ConstructorDescriptionContentEncoding
(String value) Constructor.ContentEncoding
(Supplier<String> value) Constructor with delayed value. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContentEncoding
Static creator.static ContentEncoding
Static creator with delayed value.Methods inherited from class org.apache.juneau.http.header.BasicStringHeader
assertString, asString, getValue, of, of, ofPair, orElse
Methods inherited from class org.apache.juneau.http.header.BasicHeader
assertName, assertStringValue, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, of, toString
-
Constructor Details
-
ContentEncoding
Constructor.- Parameters:
value
- The header value.
Can benull .
-
ContentEncoding
Constructor with delayed value.Header value is re-evaluated on each call to
BasicStringHeader.getValue()
.- Parameters:
value
- The supplier of the header value.
Can benull .
-
-
Method Details
-
of
Static creator.- Parameters:
value
- The header value.
Can benull .- Returns:
- A new header bean, or
null if the value isnull .
-
of
Static creator with delayed value.Header value is re-evaluated on each call to
BasicStringHeader.getValue()
.- Parameters:
value
- The supplier of the header value.
Can benull .- Returns:
- A new header bean, or
null if the value isnull .
-