A cookie name-value pair.
A cookie name-value pair.
The name
and value
should be already encoded (if necessary), as when serialised, they end up unmodified in
the header.
A cookie name-value pair with directives.
A cookie name-value pair with directives.
All String
values should be already encoded (if necessary), as when serialised, they end up unmodified in the
header.
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.
A decoded representation of a multipart part.
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.
A URI.
A URI. 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.
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.
For a description of the behavior of apply
, parse
, safeApply
and unsafeApply
methods, see sttp.model.
For a description of the behavior of apply
, safeApply
and unsafeApply
methods, see sttp.model.
For a description of the behavior of apply
, parse
, safeApply
and unsafeApply
methods, see sttp.model.
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.
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.
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 behttp://...
, 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].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