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
  • package internal
  • package sse
  • ContentRangeUnits
  • ContentTypeRange
  • Encodings
  • HasHeaders
  • Header
  • HeaderNames
  • Headers
  • HttpVersion
  • MediaType
  • MediaTypes
  • Method
  • Methods
  • Part
  • QueryParams
  • RequestMetadata
  • ResponseMetadata
  • StatusCode
  • StatusCodes
  • StatusText
  • Uri
  • UriInterpolator
p

sttp

model

package model

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
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. model
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait ContentRangeUnits extends AnyRef
  2. case class ContentTypeRange(mainType: String, subType: String, charset: String, otherParameters: Map[String, String]) extends Product with Serializable
  3. trait Encodings extends AnyRef
  4. trait HasHeaders extends AnyRef
  5. class Header extends AnyRef

    An HTTP header.

    An HTTP header. The name property is case-insensitive during equality checks.

    To compare if two headers have the same name, use the is method, which does a case-insensitive check, instead of comparing the name property.

    The name and value should be already encoded (if necessary), as when serialised, they end up unmodified in the header.

  6. trait HeaderNames extends AnyRef
  7. case class Headers(headers: Seq[Header]) extends HasHeaders with Product with Serializable
  8. sealed trait HttpVersion extends AnyRef
  9. case class MediaType(mainType: String, subType: String, charset: Option[String] = None, otherParameters: Map[String, String] = Map.empty) extends Product with Serializable
  10. trait MediaTypes extends AnyRef
  11. final case class Method(method: String) extends AnyVal with Product with Serializable
  12. trait Methods extends AnyRef
  13. case class Part[+T](name: String, body: T, otherDispositionParams: Map[String, String], headers: Seq[Header]) extends HasHeaders with Product with Serializable

    A decoded representation of a multipart part.

  14. case class QueryParams(ps: Seq[(String, Seq[String])]) extends Product with Serializable

    Represents query parameters, where each parameter can have 0, 1, or more values.

    Represents query parameters, where each parameter can have 0, 1, or more values. All query parameters are assumed to be decoded.

  15. trait RequestMetadata extends HasHeaders
  16. trait ResponseMetadata extends HasHeaders
  17. final class StatusCode extends AnyVal
  18. trait StatusCodes extends AnyRef
  19. case class StatusText(text: String) extends Product with Serializable
  20. case class Uri(scheme: Option[String], authority: Option[Authority], pathSegments: PathSegments, querySegments: Seq[QuerySegment], fragmentSegment: Option[Segment]) extends Product with Serializable

    A URI.

    A URI. Can represent both relative and absolute URIs, hence in terms of https://tools.ietf.org/html/rfc3986, this is a URI reference.

    All components (scheme, host, query, ...) are stored decoded, and become encoded upon serialization (using toString).

    Instances can be created using the uri interpolator: uri"..." (see UriInterpolator), or the factory methods on the Uri companion object.

    The apply/safeApply/unsafeApply methods create absolute URIs and require a host. The relative methods creates a relative URI, given path/query/fragment components.

    querySegments

    Either key-value pairs, single values, or plain query segments. Key value pairs will be serialized as k=v, and blocks of key-value pairs/single values will be combined using &. Note that no & or other separators are added around plain query segments - if required, they need to be added manually as part of the plain query segment. Custom encoding logic can be provided when creating a segment.

  21. trait UriInterpolator extends AnyRef

Value Members

  1. object ContentRangeUnits extends ContentRangeUnits
  2. object ContentTypeRange extends Serializable
  3. object Encodings extends Encodings
  4. object Header

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

  5. object HeaderNames extends HeaderNames
  6. object Headers extends Serializable
  7. object HttpVersion
  8. object MediaType extends MediaTypes with Serializable

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

  9. object Method extends Methods with Serializable

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

  10. object Part extends Serializable
  11. object QueryParams extends Serializable
  12. object RequestMetadata
  13. object ResponseMetadata
  14. object StatusCode extends StatusCodes

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

  15. object StatusText extends Serializable
  16. object Uri extends UriInterpolator with Serializable

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

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

    The safeApply methods return a validation error if the scheme contains illegal characters or if the host is empty.

  17. object UriInterpolator

Inherited from AnyRef

Inherited from Any

Ungrouped