MediaType

object MediaType extends MediaTypes

For a description of the behavior of apply, parse, safeApply and unsafeApply methods, see sttp.model.

Companion:
class
trait Product
trait Mirror
class Object
trait Matchable
class Any

Type members

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def bestMatch(mediaTypes: Seq[MediaType], ranges: Seq[ContentTypeRange]): Option[MediaType]
Value parameters:
mediaTypes

Candidate media types

ranges

Content type ranges, sorted in order of preference.

def parse(t: String): Either[String, MediaType]
def safeApply(mainType: String, subType: String, charset: Option[String], parameters: Map[String, String]): Either[String, MediaType]
def unsafeApply(mainType: String, subType: String, charset: Option[String], parameters: Map[String, String]): MediaType
Throws:
IllegalArgumentException

If the main type or subt type contain illegal characters.

def unsafeParse(s: String): MediaType