Response handling specification which isn't derived from another response handling method, but needs to be handled directly by the backend.
Provide an implicit value of this type to serialize arbitrary classes into a request body.
Provide an implicit value of this type to serialize arbitrary classes into a request body. Backends might also provide special logic for serializer instances which they define (e.g. to handle streaming).
A synchronous backend that safely wraps SttpBackend exceptions in Either[Throwable, ?]
's
A synchronous backend that safely wraps SttpBackend exceptions in Either[Throwable, ?]
's
The type of streams that are supported by the backend. Nothing
,
if streaming requests/responses is not supported by this backend.
Use the factory methods multipart
to conveniently create instances of
this class.
Use the factory methods multipart
to conveniently create instances of
this class. A part can be then further customised using fileName
,
contentType
and header
methods.
Specifies if the method & uri are specified. By default can be
either:
* Empty
, which is a type constructor which always resolves to
None
. This type of request is aliased to PartialRequest
:
there's no method and uri specified, and the request cannot be
sent.
* Id
, which is an identity type constructor. This type of
request is aliased to Request
: the method and uri are
specified, and the request can be sent.
What's the target type to which the response body should be read. Needs to be specified upfront so that the response is always consumed and hence there are no requirements on client code to consume it. An exception to this are streaming responses, which need to fully consumed by the client if such a response type is requested.
Request-specific tags which can be used by backends for logging, metrics, etc. Not used by default.
Right(T)
, if the request was successful (status code 2xx).
The body is then handled as specified in the request.
Left(Array[Byte])
, if the request wasn't successful (status code
3xx, 4xx or 5xx).
If redirects are followed, and there were redirects, contains responses for the intermediate requests. The first response (oldest) comes first.
Target type as which the response will be read.
If T
is a stream, the type of the stream. Otherwise, Nothing
.
The type constructor in which responses are wrapped. E.g. Id
for synchronous backends, Future
for asynchronous backends.
The type of streams that are supported by the backend. Nothing
,
if streaming requests/responses is not supported by this backend.
A synchronous backend that safely wraps SttpBackend exceptions in Try
's
A synchronous backend that safely wraps SttpBackend exceptions in Try
's
The type of streams that are supported by the backend. Nothing
,
if streaming requests/responses is not supported by this backend.
A URI.
A URI. All components (scheme, host, query, ...) are stored unencoded, and become encoded upon serialization (using toString).
Either key-value pairs, single values, or plain
query fragments. 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 fragments - if
required, they need to be added manually as part of the plain query
fragment.
Use the given encoding by default, unless specified otherwise in the response headers.
Use the given encoding by default, unless specified otherwise in the response headers.
Use the utf-8
encoding by default, unless specified otherwise in the response headers.
Use the utf-8
encoding by default, unless specified otherwise in the response headers.
Use the given encoding by default, unless specified otherwise in the response headers.
Use the given encoding by default, unless specified otherwise in the response headers.
Use the utf-8
encoding by default, unless specified otherwise in the response headers.
Use the utf-8
encoding by default, unless specified otherwise in the response headers.
An empty request with no headers.
An empty request with no headers.
Content type will be set to application/octet-stream
, can be
overridden later using the contentType
method.
Content type will be set to application/octet-stream
, can be
overridden later using the contentType
method.
Encodes the given parameters as form data.
Encodes the given parameters as form data.
Content type will be set to application/x-www-form-urlencoded
, can be
overridden later using the contentType
method.
Encodes the given parameters as form data using utf-8
.
Encodes the given parameters as form data using utf-8
.
Content type will be set to application/x-www-form-urlencoded
, can be
overridden later using the contentType
method.
Encodes the given parameters as form data.
Encodes the given parameters as form data.
Content type will be set to application/x-www-form-urlencoded
, can be
overridden later using the contentType
method.
Encodes the given parameters as form data using utf-8
.
Encodes the given parameters as form data using utf-8
.
Content type will be set to application/x-www-form-urlencoded
, can be
overridden later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to text/plain
with utf-8
encoding, can be
overridden later using the contentType
method.
Content type will be set to text/plain
with utf-8
encoding, can be
overridden later using the contentType
method.
Content type will be set to text/plain
with utf-8
encoding, can be
overridden later using the contentType
method.
Content type will be set to text/plain
with utf-8
encoding, can be
overridden later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
File name will be set to the name of the file.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
Content type will be set to application/octet-stream
, can be overridden
later using the contentType
method.
File name will be set to the name of the file.
A starting request, with the following modifications comparing to
emptyRequest
:
A starting request, with the following modifications comparing to
emptyRequest
:
- Accept-Encoding
set to gzip, deflate
(handled automatically by the
library)