MediaType

Methods
7
Fields
None

Getting one

MediaType.get(…)
MediaType.parse(…)
RequestBody.create(…):contentType()

Methods

MethodReturnsDescription
type()stringThe top-level type, lowercase (application).
subtype()stringThe subtype, lowercase (json).
charset()string?The charset parameter as a canonical charset name (UTF-8), or nil.
equals(any)booleanWhether other is a media type of the same text.
toString()stringThe text it was made from.
get(string)MediaTypeThe media type string names; a malformed one is IllegalArgumentException.
parse(string)MediaType?The media type string names, or nil when it is malformed.

Returned by

MethodReturnsDescription
MediaTypeClass.getMediaTypeThe media type string names; a malformed one is IllegalArgumentException.
MediaTypeClass.parseMediaType?The media type string names, or nil when it is malformed.
RequestBody.contentTypeMediaType?The content type, or nil.
ResponseBody.contentTypeMediaType?The Content-Type, or nil.

Method details

type

type: (MediaType) -> string

The top-level type, lowercase (application).

charset

charset: (MediaType) -> string?

The charset parameter as a canonical charset name (UTF-8), or nil.

equals

equals: (MediaType, any) -> boolean

Whether other is a media type of the same text.

get

get: (string) -> MediaType

The media type string names; a malformed one is IllegalArgumentException.

parse

parse: (string) -> MediaType?

The media type string names, or nil when it is malformed.