Skip to content

MediaType

[Source]

An HTTP media type consisting of a top-level type and subtype.

Both components are lowercased at construction for case-insensitive comparison. No validation is performed on the values — this is consistent with Header, which stores names and values as-is.

Use ContentNegotiation to match media types against an Accept header.

class val MediaType is
  Equatable[MediaType val] ref,
  Stringable box

Implements


Constructors

create

[Source]

Create a media type with the given type and subtype, lowercased.

new val create(
  type_name': String val,
  subtype': String val)
: MediaType val^

Parameters

Returns


Public fields

let type_name: String val

[Source]


let subtype: String val

[Source]


Public Functions

eq

[Source]

fun box eq(
  that: MediaType val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: MediaType val)
: Bool val

Parameters

Returns


string

[Source]

fun box string()
: String iso^

Returns