sttp.model

package sttp.model

Type members

Classlikes

case class ContentTypeRange(mainType: String, subType: String, charset: String)
Companion
object
Companion
class
trait HasHeaders
class Header(val name: String, val value: String)

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

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.

Companion
object
object Header

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

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

Companion
class
Companion
object
object HeaderNames extends HeaderNames
Companion
class
case class Headers(headers: Seq[Header]) extends HasHeaders
Companion
object
object Headers
Companion
class
case class MediaType(mainType: String, subType: String, charset: Option[String], otherParameters: Map[String, String])
Companion
object
object MediaType extends MediaTypes

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

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

Companion
class
trait MediaTypes
final case class Method(method: String) extends AnyVal
Companion
object
object Method extends Methods

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

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

Companion
class
trait Methods
case class Part[+T](name: String, body: T, otherDispositionParams: Map[String, String], headers: Seq[Header]) extends HasHeaders

A decoded representation of a multipart part.

A decoded representation of a multipart part.

Companion
object
object Part
Companion
class
case class QueryParams(ps: Seq[(String, Seq[String])])

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

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

Companion
object
object QueryParams
Companion
class
Companion
object
Companion
class
Companion
object
Companion
class
final class StatusCode(val code: Int) extends AnyVal
Companion
object
object StatusCode extends StatusCodes

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

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

Companion
class
case class Uri(scheme: Option[String], authority: Option[Authority], pathSegments: PathSegments, querySegments: Seq[QuerySegment], fragmentSegment: Option[Segment])

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

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.

Value Params
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.

Companion
object
object Uri extends UriInterpolator

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.

Companion
class
Companion
object
Companion
class