Package org.opensearch.common.xcontent
Interface MediaType
- All Known Implementing Classes:
XContentType
public interface MediaType
Abstracts a Media Type and a format parameter.
Media types are used as values on Content-Type and Accept headers
format is an URL parameter, specifies response media type.
-
Method Summary
-
Method Details
-
type
String type()Returns a type part of a MediaType i.e. application for application/json -
subtype
String subtype()Returns a subtype part of a MediaType. i.e. json for application/json -
format
String format()Returns a corresponding format for a MediaType. i.e. json for application/json media type Can differ from the MediaType's subtype i.e plain/text has a subtype of text but format is txt -
typeWithSubtype
returns a string representation of a media type.
-