Describes a HTTP request, along with a description of how the response body should be handled.
The request can be sent:
- synchronously, using SimpleHttpClient.send
- using the send methods, which support any effect. The backend must provide a superset of the capabilities required by the request.
Type parameters
- R
-
The backend capabilities required by the request or response description. This might be
Any
(no requirements), Effect (the backend must support the given effect type), Streams (the ability to send and receive streaming bodies) or sttp.capabilities.WebSockets (the ability to handle websocket requests). - T
-
The target type, to which the response body should be read.
- U
-
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. * Identity, 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.
Value parameters
- response
-
Description of how the response body should be handled. 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 unsafe streaming and websocket responses, which need to be consumed/closed by the client.
- tags
-
Request-specific tags which can be used by backends for logging, metrics, etc. Not used by default.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait HasHeadersclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Uses the utf-8
encoding.
Uses the utf-8
encoding.
If content type is not yet specified, will be set to text/plain
with utf-8
encoding.
If content length is not yet specified, will be set to the number of bytes in the string using the utf-8
encoding.
Attributes
If content type is not yet specified, will be set to text/plain
with the given encoding.
If content type is not yet specified, will be set to text/plain
with the given encoding.
If content length is not yet specified, will be set to the number of bytes in the string using the given encoding.
Attributes
If content type is not yet specified, will be set to application/octet-stream
.
If content type is not yet specified, will be set to application/octet-stream
.
If content length is not yet specified, will be set to the length of the given array.
Attributes
If content type is not yet specified, will be set to application/octet-stream
.
If content type is not yet specified, will be set to application/octet-stream
.
Attributes
If content type is not yet specified, will be set to application/octet-stream
.
If content type is not yet specified, will be set to application/octet-stream
.
Attributes
Encodes the given parameters as form data using utf-8
. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
Encodes the given parameters as form data using utf-8
. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.
Attributes
Encodes the given parameters as form data. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
Encodes the given parameters as form data. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.
Attributes
Encodes the given parameters as form data using utf-8
. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
Encodes the given parameters as form data using utf-8
. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.
Attributes
Encodes the given parameters as form data. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
Encodes the given parameters as form data. If content type is not yet specified, will be set to application/x-www-form-urlencoded
.
If content length is not yet specified, will be set to the length of the number of bytes in the url-encoded parameter string.
Attributes
Adds the given header to the end of the headers sequence.
Adds the given header to the end of the headers sequence.
Value parameters
- replaceExisting
-
If there's already a header with the same name, should it be replaced?
Attributes
Adds the given header to the end of the headers sequence.
Adds the given header to the end of the headers sequence.
Value parameters
- replaceExisting
-
If there's already a header with the same name, should it be replaced?
Attributes
Adds the given header to the end of the headers sequence.
Adds the given header to the end of the headers sequence.
Attributes
Adds the given header to the end of the headers sequence, if the value is defined. Otherwise has no effect.
Adds the given header to the end of the headers sequence, if the value is defined. Otherwise has no effect.
Attributes
Adds the given headers to the end of the headers sequence.
Adds the given headers to the end of the headers sequence.
Attributes
Adds the given headers to the end of the headers sequence.
Adds the given headers to the end of the headers sequence.
Value parameters
- replaceExisting
-
If there's already a header with the same name, should it be replaced?
Attributes
Adds the given headers to the end of the headers sequence.
Adds the given headers to the end of the headers sequence.
Attributes
Adds the given headers to the end of the headers sequence.
Adds the given headers to the end of the headers sequence.
Attributes
Allows setting HTTP version per request. Supported only is a few backends
Allows setting HTTP version per request. Supported only is a few backends
Value parameters
- version:
-
one of values from HttpVersion enum.
Attributes
- Returns
-
request with version tag
GetHttpVersion from tags in request. Supported only is a few backends
GetHttpVersion from tags in request. Supported only is a few backends
Attributes
- Returns
-
one of values form HttpVersion enum or None
Will only have effect when using the LoggingBackend
Will only have effect when using the LoggingBackend
Attributes
When the request is sent, if reading the response times out (there's no activity for the given period of time), a failed effect will be returned, or an exception will be thrown
When the request is sent, if reading the response times out (there's no activity for the given period of time), a failed effect will be returned, or an exception will be thrown
Attributes
When a POST or PUT request is redirected, should the redirect be a POST/PUT as well (with the original body), or should the request be converted to a GET without a body.
When a POST or PUT request is redirected, should the redirect be a POST/PUT as well (with the original body), or should the request be converted to a GET without a body.
Note that this only affects 301 and 302 redirects. 303 redirects are always converted, while 307 and 308 redirects always keep the same method.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections for details.
Attributes
Specifies the target type to which the response body should be read. Note that this replaces any previous specifications, which also includes any previous mapResponse
invocations.
Specifies the target type to which the response body should be read. Note that this replaces any previous specifications, which also includes any previous mapResponse
invocations.
Attributes
Sends the request, using the given backend. Only requests for which the method & URI are specified can be sent.
Sends the request, using the given backend. Only requests for which the method & URI are specified can be sent.
The required capabilities must be a subset of the capabilities provided by the backend.
Attributes
- Returns
-
For synchronous backends (when the effect type is Identity), Response is returned directly and exceptions are thrown. For asynchronous backends (when the effect type is e.g. scala.concurrent.Future), an effect containing the Response is returned. Exceptions are represented as failed effects (e.g. failed futures). The response body is deserialized as specified by this request (see RequestT.response). Known exceptions are converted by backends to one of SttpClientException. Other exceptions are thrown unchanged.
Deprecated methods
Sends the request, using the backend from the implicit scope. Only requests for which the method & URI are specified can be sent.
Sends the request, using the backend from the implicit scope. Only requests for which the method & URI are specified can be sent.
The required capabilities must be a subset of the capabilities provided by the backend.
Attributes
- Returns
-
For synchronous backends (when the effect type is Identity), Response is returned directly and exceptions are thrown. For asynchronous backends (when the effect type is e.g. scala.concurrent.Future), an effect containing the Response is returned. Exceptions are represented as failed effects (e.g. failed futures). The response body is deserialized as specified by this request (see RequestT.response). Known exceptions are converted by backends to one of SttpClientException. Other exceptions are thrown unchanged.
- Deprecated
-
[Since version 3.0.0]
use request.send(backend), providing the backend explicitly
Inherited methods
If content type is not yet specified, will be set to application/octet-stream
.
If content type is not yet specified, will be set to application/octet-stream
.
Attributes
- Inherited from:
- RequestTExtensions
If content type is not yet specified, will be set to application/octet-stream
.
If content type is not yet specified, will be set to application/octet-stream
.
If content length is not yet specified, will be set to the length of the given file.
Attributes
- Inherited from:
- RequestTExtensions
If content type is not yet specified, will be set to application/octet-stream
.
If content type is not yet specified, will be set to application/octet-stream
.
If content length is not yet specified, will be set to the length of the given file.
Attributes
- Inherited from:
- RequestTExtensions
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- HasHeaders