StreamRequest
Describes an HTTP request, along with a description of how the response body should be handled. Either the request or response body uses non-blocking, asynchronous streams.
The request can be sent using an instance of StreamBackend with the send method.
Type parameters
- R
-
The capabilities required to send this request: a subtype of Streams, and optionally an Effect.
- T
-
The target type, to which the response body should be read. If the response body is streamed, this might be the value obtained by processing the entire stream.
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.
- tags
-
Request-specific tags which can be used by backends for logging, metrics, etc. Empty by default.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait RequestMetadatatrait HasHeadersclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Set the method & uri to the given ones.
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
Specifies that the response body should be processed using a non-blocking, asynchronous stream, as witnessed by the R2
capability. This capability must be a subset of any capabilities required by previously (R
). A StreamBackend will be required to send this request.
Specifies that the response body should be processed using a non-blocking, asynchronous stream, as witnessed by the R2
capability. This capability must be a subset of any capabilities required by previously (R
). A StreamBackend will be required to send this request.
Attributes
Specifies that this is a WebSocket request. A WebSocketStreamBackend will be required to send this request.
Specifies that this is a WebSocket request. A WebSocketStreamBackend will be required to send this request.
Attributes
Sends the request, using the given backend.
Sends the request, using the given backend.
The required capabilities R
must be a subset of the capabilities P
provided by the backend. That is, the supported streams type must match, as well as the optional effect type.
Attributes
- Returns
-
An
F
-effect, containing a Response, with the body handled as specified by this request (see Request.response). Effects might include asynchronous computations (e.g. scala.concurrent.Future), pure effect descriptions (IO
), or error wrappers (e.g. TryBackend). Exceptions are represented as failed effects (e.g. failed futures). The response body is deserialized as specified by this request (see Request.response). Known exceptions are converted by backends to one of SttpClientException. Other exceptions are thrown unchanged.
Attributes
- Definition Classes
Replace all headers with the given ones.
Replace all options with the given ones.
Replace all tags with the given ones.
Inherited methods
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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:
- PartialRequestBuilder
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:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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:
- PartialRequestExtensions
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:
- PartialRequestExtensions
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
Adds the given header to the end of the headers sequence.
Adds the given header to the end of the headers sequence.
Attributes
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- HasHeaders
Adds the given headers to the end of the headers sequence.
Adds the given headers to the end of the headers sequence.
Attributes
- Inherited from:
- PartialRequestBuilder
Adds the given headers to the end of the headers sequence.
Adds the given headers to the end of the headers sequence.
Attributes
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
Adds the given headers to the end of the headers sequence.
Adds the given headers to the end of the headers sequence.
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- HasHeaders
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- GenericRequest
Will only have effect when using the LoggingBackend
Will only have effect when using the LoggingBackend
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Metadata of the request, which doesn't retain the request body, or the response handling specification.
Metadata of the request, which doesn't retain the request body, or the response handling specification.
Attributes
- Inherited from:
- GenericRequest
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
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
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- PartialRequestBuilder
Attributes
- Inherited from:
- GenericRequest
Attributes
- Inherited from:
- GenericRequest
Attributes
- Inherited from:
- GenericRequest
Attributes
- Inherited from:
- GenericRequest
Attributes
- Inherited from:
- GenericRequest
Attributes
- Inherited from:
- GenericRequest
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
RequestMetadata -> Any
- Inherited from:
- RequestMetadata
Attributes
- Inherited from:
- HasHeaders
Attributes
- Inherited from:
- PartialRequestBuilder