@Header(value="Content-Type") public class ContentType extends MediaType
The MIME type of this content.
Content-Type: text/html; charset=utf-8
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
Modifier and Type | Method and Description |
---|---|
int |
findMatch(MediaType[] mediaTypes)
Given a list of media types, returns the best match for this
Content-Type header. |
static ContentType |
forString(String value)
Returns a parsed
Content-Type header. |
compareTo, equals, forStrings, getParameters, getSubType, getSubTypes, getType, hashCode, hasSubType, isMeta, match, toString
public static ContentType forString(String value)
Content-Type
header.value
- The Content-Type
header string.Content-Type
header, or public int findMatch(MediaType[] mediaTypes)
Content-Type
header.
Note that fuzzy matching is allowed on the media types where the Content-Types
header may
contain additional subtype parts.
For example, given a Content-Type
value of
The purpose for this is to allow parsers to match when artifacts such as id
properties are
present in the header.
mediaTypes
- The media types to match against.-1
if no suitable matches could be found.Copyright © 2018 Apache. All rights reserved.