Packages

  • package root
    Definition Classes
    root
  • package sttp
    Definition Classes
    root
  • package model

    Most model classes contain both serialisation & parsing functionality, following these conventions:

    Most model classes contain both serialisation & parsing functionality, following these conventions:

    • .toString returns a representation of the model class in a format as in an HTTP request/response. For example, for an uri this will be http://..., for a header [name]: [value], etc.
    • [SthCompanionObject].parse(serialized: String): Either[String, Sth]: returns an error message or an instance of the model class
    • [SthCompanionObject].unsafeParse(serialized: String): Sth: returns an instance of the model class or in case of an error, *throws an exception*.
    • [SthCompanionObject].unsafeApply(values): creates an instance of the model class; validates the input values and in case of an error, *throws an exception*. An error could be e.g. that the input values contain characters outside of the allowed range
    • [SthCompanionObject].safeApply(...): Either[String, Sth]: same as above, but doesn't throw exceptions. Instead, returns an error message or the model class instance
    • [SthCompanionObject].apply(...): Sth: creates the model type, without validation, and without throwing exceptions
    Definition Classes
    sttp
  • package headers
    Definition Classes
    model
  • package internal
    Definition Classes
    model
  • package sse
    Definition Classes
    model
  • ContentRangeUnits
  • ContentTypeRange
  • Encodings
  • HasHeaders
  • Header
  • HeaderNames
  • Headers
  • HttpVersion
  • MediaType
  • MediaTypes
  • Method
  • Methods
  • Part
  • QueryParams
  • RequestMetadata
  • ResponseMetadata
  • StatusCode
  • StatusCodes
  • StatusText
  • Uri
  • UriInterpolator

object MediaType extends MediaTypes with Serializable

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

Linear Supertypes
Serializable, Serializable, MediaTypes, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MediaType
  2. Serializable
  3. Serializable
  4. MediaTypes
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val ApplicationGzip: MediaType
    Definition Classes
    MediaTypes
  5. val ApplicationJson: MediaType
    Definition Classes
    MediaTypes
  6. val ApplicationOctetStream: MediaType
    Definition Classes
    MediaTypes
  7. val ApplicationPdf: MediaType
    Definition Classes
    MediaTypes
  8. val ApplicationRtf: MediaType
    Definition Classes
    MediaTypes
  9. val ApplicationXWwwFormUrlencoded: MediaType
    Definition Classes
    MediaTypes
  10. val ApplicationXhtml: MediaType
    Definition Classes
    MediaTypes
  11. val ApplicationXml: MediaType
    Definition Classes
    MediaTypes
  12. val ApplicationZip: MediaType
    Definition Classes
    MediaTypes
  13. val ImageGif: MediaType
    Definition Classes
    MediaTypes
  14. val ImageJpeg: MediaType
    Definition Classes
    MediaTypes
  15. val ImagePng: MediaType
    Definition Classes
    MediaTypes
  16. val ImageTiff: MediaType
    Definition Classes
    MediaTypes
  17. val MultipartAlternative: MediaType
    Definition Classes
    MediaTypes
  18. val MultipartFormData: MediaType
    Definition Classes
    MediaTypes
  19. val MultipartMixed: MediaType
    Definition Classes
    MediaTypes
  20. val TextCacheManifest: MediaType
    Definition Classes
    MediaTypes
  21. val TextCalendar: MediaType
    Definition Classes
    MediaTypes
  22. val TextCss: MediaType
    Definition Classes
    MediaTypes
  23. val TextCsv: MediaType
    Definition Classes
    MediaTypes
  24. val TextEventStream: MediaType
    Definition Classes
    MediaTypes
  25. val TextHtml: MediaType
    Definition Classes
    MediaTypes
  26. val TextJavascript: MediaType
    Definition Classes
    MediaTypes
  27. val TextPlain: MediaType
    Definition Classes
    MediaTypes
  28. val TextPlainUtf8: MediaType
    Definition Classes
    MediaTypes
  29. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  30. def bestMatch(mediaTypes: Seq[MediaType], ranges: Seq[ContentTypeRange]): Option[MediaType]

    mediaTypes

    Candidate media types

    ranges

    Content type ranges, sorted in order of preference.

  31. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  32. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  34. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  35. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  36. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  39. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  40. def parse(t: String): Either[String, MediaType]
  41. def safeApply(mainType: String, subType: String, charset: Option[String] = None, parameters: Map[String, String] = Map.empty): Either[String, MediaType]
  42. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  43. def toString(): String
    Definition Classes
    AnyRef → Any
  44. def unsafeApply(mainType: String, subType: String, charset: Option[String] = None, parameters: Map[String, String] = Map.empty): MediaType

    Exceptions thrown

    IllegalArgumentException If the main type or subt type contain illegal characters.

  45. def unsafeParse(s: String): MediaType
  46. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Serializable

Inherited from Serializable

Inherited from MediaTypes

Inherited from AnyRef

Inherited from Any

Ungrouped