Package org.apache.juneau.http.header
Class ContentType
java.lang.Object
org.apache.juneau.http.header.BasicHeader
org.apache.juneau.http.header.BasicStringHeader
org.apache.juneau.http.header.BasicMediaTypeHeader
org.apache.juneau.http.header.ContentType
- All Implemented Interfaces:
Serializable
,Cloneable
,Header
,NameValuePair
Represents a parsed Content-Type HTTP request/response header.
The MIME type of this content.
Example
Content-Type: text/html; charset=utf-8
RFC2616 Specification
The Content-Type entity-header field indicates the media type of the entity-body sent to the recipient or, in the case of the HEAD method, the media type that would have been sent had the request been a GET.Content-Type = "Content-Type" ":" media-type
Media types are defined in section 3.7. An example of the field is...
Content-Type: text/html; charset=ISO-8859-4
See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
static final ContentType
-
Constructor Summary
ConstructorsConstructorDescriptionContentType
(String value) Constructor.ContentType
(Supplier<MediaType> value) Constructor with delayed value.ContentType
(MediaType value) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContentType
Static creator.static ContentType
Static creator with delayed value.static ContentType
Static creator.Methods inherited from class org.apache.juneau.http.header.BasicMediaTypeHeader
asMediaType, getParameter, getParameters, getSubType, getSubTypes, getType, getValue, hasSubType, isMetaSubtype, match, match, of, of, orElse, toMediaType
Methods inherited from class org.apache.juneau.http.header.BasicStringHeader
assertString, asString, 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
-
Field Details
-
APPLICATION_ATOM_XML
-
APPLICATION_FORM_URLENCODED
-
APPLICATION_JSON
-
APPLICATION_OCTET_STREAM
-
APPLICATION_SOAP_XML
-
APPLICATION_SVG_XML
-
APPLICATION_XHTML_XML
-
APPLICATION_XML
-
IMAGE_BMP
-
IMAGE_GIF
-
IMAGE_JPEG
-
IMAGE_PNG
-
IMAGE_SVG
-
IMAGE_TIFF
-
IMAGE_WEBP
-
MULTIPART_FORM_DATA
-
TEXT_HTML
-
TEXT_OPENAPI
-
TEXT_PLAIN
-
TEXT_XML
-
WILDCARD
-
NULL
-
-
Constructor Details
-
ContentType
Constructor.- Parameters:
value
- The header value.
Must be parsable byMediaType.of(String)
.
Can benull .
-
ContentType
Constructor.- Parameters:
value
- The header value.
Can benull .
-
ContentType
Constructor with delayed value.Header value is re-evaluated on each call to
BasicMediaTypeHeader.getValue()
.- Parameters:
value
- The supplier of the header value.
Can benull .
-
-
Method Details
-
of
Static creator.- Parameters:
value
- The header value.
Must be parsable byMediaType.of(String)
.
Can benull .- Returns:
- A new header bean, or
null if the value isnull .
-
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
BasicMediaTypeHeader.getValue()
.- Parameters:
value
- The header value.
Can benull .- Returns:
- A new header bean, or
null if the value isnull .
-