package client4
- Alphabetic
- By Inheritance
- client4
- SttpApi
- UriInterpolator
- SttpExtensions
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Backend[F[_]] extends GenericBackend[F, Any]
A GenericBackend which doesn't support any capabilities, and uses
F
to represent side-effects. - case class BackendOptions(connectionTimeout: FiniteDuration, proxy: Option[Proxy]) extends Product with Serializable
- sealed trait BasicBody extends GenericRequestBody[Any]
- sealed trait BasicBodyPart extends BasicBody with BodyPart[Any]
- case class BasicMultipartBody(parts: Seq[Part[BasicBodyPart]]) extends MultipartBody[Any] with BasicBody with Product with Serializable
- sealed trait BodyPart[-S] extends GenericRequestBody[S]
-
type
BodySerializer[B] = (B) ⇒ BasicBodyPart
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).
- case class ByteArrayBody(b: Array[Byte], defaultContentType: MediaType = MediaType.ApplicationOctetStream) extends BasicBodyPart with Product with Serializable
- case class ByteBufferBody(b: ByteBuffer, defaultContentType: MediaType = MediaType.ApplicationOctetStream) extends BasicBodyPart with Product with Serializable
-
case class
ConditionalResponseAs[+R](condition: (ResponseMetadata) ⇒ Boolean, responseAs: R) extends Product with Serializable
A wrapper around a ResponseAs to supplement it with a condition on the response metadata.
A wrapper around a ResponseAs to supplement it with a condition on the response metadata.
Used in SttpApi.fromMetadata() to condition the response handler upon the response metadata: status code, headers, etc.
- R
The type of response
- case class DeserializationException[DE](body: String, error: DE)(implicit evidence$1: ShowError[DE]) extends ResponseException[Nothing, DE] with Product with Serializable
- case class FileBody(f: SttpFile, defaultContentType: MediaType = MediaType.ApplicationOctetStream) extends BasicBodyPart with Product with Serializable
-
trait
GenericBackend[F[_], +P] extends AnyRef
A specific implementation of HTTP request sending logic.
A specific implementation of HTTP request sending logic.
The send method should not be used directly by client code, if possible. Instead, the Request.send, StreamRequest.send, WebSocketRequest.send or WebSocketStreamRequest.send methods (depending on the type of the request) should be used, providing a specific backend instance as a parameter.
When creating an instance of a backend, one of the Backend traits should be mixed in, reflecting the effect type and the
P
capabilities: Backend, SyncBackend, WebSocketBackend, WebSocketSyncBackend, StreamBackend, WebSocketStreamBackend. This is required in order to provide a better developer experience when sending requests: the resulting type has less type parameters.- F
The effect type used to represent side-effects, such as obtaining the response for a request. E.g. Identity for synchronous backends, scala.concurrent.Future for asynchronous backends.
- P
Capabilities supported by this backend, in addition to Effect. This might be
Any
(no special capabilities), subtype of sttp.capabilities.Streams (the ability to send and receive streaming bodies) or WebSockets (the ability to handle websocket requests).
- Note
Backends should try to classify known HTTP-related exceptions into one of the categories specified by SttpClientException. Other exceptions are thrown unchanged.
-
trait
GenericRequest[+T, -R] extends RequestBuilder[GenericRequest[T, R]] with RequestMetadata
A generic description of an HTTP request, along with a description of how the response body should be handled.
A generic description of an HTTP request, along with a description of how the response body should be handled.
Client code should use concrete subtypes of this trait. The Request.send, StreamRequest.send, WebSocketRequest.send or WebSocketStreamRequest.send methods should be used to send the request, providing an instance of the appropriate Backend subtype.
However, the request can aso be sent using the GenericBackend.send method, which provides a superset of the required capabilities.
- T
The target type, to which the response body should be read.
- R
The backend capabilities required by the request or response description. This might be
Any
(no requirements), sttp.capabilities.Effect (the backend must support the given effect type), sttp.capabilities.Streams (the ability to send and receive streaming bodies) or sttp.capabilities.WebSockets (the ability to handle websocket requests).
- sealed trait GenericRequestBody[-R] extends AnyRef
-
sealed
trait
GenericResponseAs[+T, -R] extends AnyRef
Generic description of how the response to a GenericRequest should be handled.
Generic description of how the response to a GenericRequest should be handled. To set on a request, should be wrapped with an appropriate subtype of ResponseAsDelegate, depending on the
R
capabilities.- T
Target type as which the response will be read.
- R
The backend capabilities required by the 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 WebSockets (the ability to handle websocket requests).
- sealed trait GenericWebSocketResponseAs[T, -R] extends GenericResponseAs[T, R]
- case class HttpError[HE](body: HE, statusCode: StatusCode) extends ResponseException[HE, Nothing] with Product with Serializable
- type Identity[+X] = X
- case class InputStreamBody(b: InputStream, defaultContentType: MediaType = MediaType.ApplicationOctetStream) extends BasicBodyPart with Product with Serializable
- case class MappedResponseAs[T, T2, R](raw: GenericResponseAs[T, R], g: (T, ResponseMetadata) ⇒ T2, showAs: Option[String]) extends GenericResponseAs[T2, R] with Product with Serializable
- sealed trait MultipartBody[S] extends GenericRequestBody[S]
- case class MultipartStreamBody[S](parts: Seq[Part[BodyPart[S]]]) extends MultipartBody[S] with Product with Serializable
-
final
case class
PartialRequest[T](body: BasicBody, headers: Seq[Header], response: ResponseAs[T], options: RequestOptions, tags: Map[String, Any]) extends PartialRequestBuilder[PartialRequest[T], Request[T]] with Product with Serializable
Describes a partial HTTP request, along with a description of how the response body should be handled.
Describes a partial HTTP request, along with a description of how the response body should be handled. A partial request cannot be sent because the method and uri are not yet specified.
- T
The target type, to which the response body should be read.
- 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.
-
trait
PartialRequestBuilder[+PR <: PartialRequestBuilder[PR, R], +R] extends HasHeaders with PartialRequestExtensions[PR]
The builder methods of requests or partial requests of type
PR
.The builder methods of requests or partial requests of type
PR
.- PR
The type of the request or partial request. The method and uri may not be specified yet.
- R
The type of request when the method and uri are specified.
- trait PartialRequestExtensions[+R <: PartialRequestBuilder[R, _]] extends AnyRef
-
case class
Request[T](method: Method, uri: Uri, body: BasicBody, headers: Seq[Header], response: ResponseAs[T], options: RequestOptions, tags: Map[String, Any]) extends GenericRequest[T, Any] with RequestBuilder[Request[T]] with Product with Serializable
Describes an HTTP request, along with a description of how the response body should be handled.
Describes an HTTP request, along with a description of how the response body should be handled.
The request can be sent using an instance of SyncBackend or Backend with the send method.
- T
The target type, to which the response body should be read.
- 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.
-
trait
RequestBuilder[+R <: RequestBuilder[R]] extends PartialRequestBuilder[R, R]
The builder methods of a request.
The builder methods of a request. The uri and method are specified.
- R
The type of request
- case class RequestOptions(followRedirects: Boolean, readTimeout: Duration, maxRedirects: Int, redirectToGet: Boolean) extends Product with Serializable
-
case class
Response[+T](body: T, code: StatusCode, statusText: String, headers: Seq[Header], history: List[Response[Unit]], request: RequestMetadata) extends ResponseMetadata with Product with Serializable
- history
If redirects are followed, and there were redirects, contains responses for the intermediate requests. The first response (oldest) comes first.
-
case class
ResponseAs[+T](delegate: GenericResponseAs[T, Any]) extends ResponseAsDelegate[T, Any] with Product with Serializable
Describes how the response body of a Request should be handled.
Describes how the response body of a Request should be handled.
Apart from the basic cases (ignoring, reading as a byte array or file), response body descriptions can be mapped over, to support custom types. The mapping can take into account the ResponseMetadata, that is the headers and status code. Responses can also be handled depending on the response metadata. Finally, two response body descriptions can be combined (with some restrictions).
A number of
as<Type>
helper methods are available as part of SttpApi and when importingsttp.client4._
.- T
Target type as which the response will be read.
- case class ResponseAsBoth[A, B, R](l: GenericResponseAs[A, R], r: GenericResponseAs[B, Any]) extends GenericResponseAs[(A, Option[B]), R] with Product with Serializable
-
trait
ResponseAsDelegate[+T, -R] extends AnyRef
Describes how the response body of a request should be handled.
Describes how the response body of a request should be handled. A number of
as<Type>
helper methods are available as part of SttpApi and when importingsttp.client4._
. These methods yield specific implementations of this trait, which can then be set on a Request, StreamRequest, WebSocketRequest or WebSocketStreamRequest, depending on the response type.- T
Target type as which the response will be read.
- R
The backend capabilities required by the response description. This might be
Any
(no requirements), sttp.capabilities.Effect (the backend must support the given effect type), sttp.capabilities.Streams (the ability to send and receive streaming bodies) or sttp.capabilities.WebSockets (the ability to handle websocket requests).
- case class ResponseAsFile(output: SttpFile) extends GenericResponseAs[SttpFile, Any] with Product with Serializable
- case class ResponseAsFromMetadata[T, R](conditions: List[ConditionalResponseAs[GenericResponseAs[T, R]]], default: GenericResponseAs[T, R]) extends GenericResponseAs[T, R] with Product with Serializable
- case class ResponseAsStream[F[_], T, Stream, S] extends GenericResponseAs[T, S with Effect[F]] with Product with Serializable
- case class ResponseAsStreamUnsafe[BinaryStream, S] extends GenericResponseAs[BinaryStream, S] with Product with Serializable
- case class ResponseAsWebSocket[F[_], T](f: (WebSocket[F], ResponseMetadata) ⇒ F[T]) extends GenericWebSocketResponseAs[T, WebSockets with Effect[F]] with Product with Serializable
- case class ResponseAsWebSocketStream[S, Pipe[_, _]](s: Streams[S], p: Pipe[Data[_], WebSocketFrame]) extends GenericWebSocketResponseAs[Unit, S with WebSockets] with Product with Serializable
- case class ResponseAsWebSocketUnsafe[F[_]]() extends GenericWebSocketResponseAs[WebSocket[F], WebSockets with Effect[F]] with Product with Serializable
- sealed abstract class ResponseException[+HE, +DE] extends Exception
- type RetryWhen = (GenericRequest[_, _], Either[Throwable, Response[_]]) ⇒ Boolean
- trait ShowError[-T] extends AnyRef
- class SpecifyAuthScheme[+R <: PartialRequestBuilder[R, _]] extends AnyRef
-
trait
StreamBackend[F[_], +S] extends Backend[F] with GenericBackend[F, S]
A GenericBackend which supports streams of type
S
and usesF
to represent side-effects. - case class StreamBody[BinaryStream, S] extends BodyPart[S] with Product with Serializable
-
final
case class
StreamRequest[T, R](method: Method, uri: Uri, body: GenericRequestBody[R], headers: Seq[Header], response: StreamResponseAs[T, R], options: RequestOptions, tags: Map[String, Any]) extends GenericRequest[T, R] with RequestBuilder[StreamRequest[T, R]] with Product with Serializable
Describes an HTTP request, along with a description of how the response body should be handled.
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.
- 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.
- R
The capabilities required to send this request: a subtype of Streams, and optionally an Effect.
- 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.
-
case class
StreamResponseAs[+T, S](delegate: GenericResponseAs[T, S]) extends ResponseAsDelegate[T, S] with Product with Serializable
Describes how the response body of a StreamRequest should be handled.
Describes how the response body of a StreamRequest should be handled.
The stream response can be mapped over, to support custom types. The mapping can take into account the ResponseMetadata, that is the headers and status code.
A number of
asStream[Type]
helper methods are available as part of SttpApi and when importingsttp.client4._
.- T
Target type as which the response will be read.
- S
The type of stream, used to receive the response body bodies.
- case class StringBody(s: String, encoding: String, defaultContentType: MediaType = MediaType.TextPlain) extends BasicBodyPart with Product with Serializable
- trait SttpApi extends SttpExtensions with UriInterpolator
-
abstract
class
SttpClientException extends Exception
Known exceptions that might occur when using a backend.
Known exceptions that might occur when using a backend. Currently this covers:
- connect exceptions: when a connection (tcp socket) can't be established to the target host
- read exceptions: when a connection has been established, but there's any kind of problem receiving or handling the response (e.g. a broken socket or a deserialization error)
In general, it's safe to assume that the request hasn't been sent in case of connect exceptions. With read exceptions, the target host might or might have not received and processed the request.
The Backend.send methods might also throw other exceptions, due to programming errors, bugs in the underlying implementations, bugs in sttp or an uncovered exception.
- trait SttpClientExceptionExtensions extends AnyRef
- trait SttpExtensions extends AnyRef
- trait SttpWebSocketAsyncApi extends AnyRef
- trait SttpWebSocketStreamApi extends AnyRef
- trait SttpWebSocketSyncApi extends AnyRef
-
trait
SyncBackend extends Backend[Identity]
A GenericBackend which is synchronous (side effects are run directly), and doesn't support any capabilities.
-
implicit
class
UriContext extends AnyRef
- Definition Classes
- UriInterpolator
-
trait
WebSocketBackend[F[_]] extends Backend[F] with GenericBackend[F, WebSockets]
A GenericBackend which supports web sockets and uses
F
to represent side-effects. -
final
case class
WebSocketRequest[F[_], T](method: Method, uri: Uri, body: BasicBody, headers: Seq[Header], response: WebSocketResponseAs[F, T], options: RequestOptions, tags: Map[String, Any]) extends GenericRequest[T, WebSockets with Effect[F]] with RequestBuilder[WebSocketRequest[F, T]] with Product with Serializable
Describes an HTTP WebSocket request.
Describes an HTTP WebSocket request.
The request can be sent using an instance of WebSocketBackend with the send method.
- F
The effect type used to process the WebSocket. Might include asynchronous computations (e.g. scala.concurrent.Future), pure effect descriptions (
IO
), or synchronous computations (Identity).- T
The target type, to which the response body should be read. If the WebSocket interactions are described entirely by the response description, this might be
Unit
. Otherwise, this can be a sttp.ws.WebSocket instance.- response
Description of how the WebSocket 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.
-
case class
WebSocketResponseAs[F[_], +T](delegate: GenericResponseAs[T, Effect[F] with WebSockets]) extends ResponseAsDelegate[T, Effect[F] with WebSockets] with Product with Serializable
Describes how the response of a WebSocketRequest should be handled.
Describes how the response of a WebSocketRequest should be handled.
The websocket response can be mapped over, to support custom types. The mapping can take into account the ResponseMetadata, that is the headers and status code. Responses can also be handled depending on the response metadata.
A number of
asWebSocket
helper methods are available as part of SttpApi and when importingsttp.client4._
.- T
Target type as which the response will be read.
-
trait
WebSocketStreamBackend[F[_], S] extends WebSocketBackend[F] with StreamBackend[F, S] with GenericBackend[F, S with WebSockets]
A GenericBackend which supports websockets, streams of type
S
and usesF
to represent side-effects. -
final
case class
WebSocketStreamRequest[T, S](method: Method, uri: Uri, body: GenericRequestBody[S], headers: Seq[Header], response: WebSocketStreamResponseAs[T, S], options: RequestOptions, tags: Map[String, Any]) extends GenericRequest[T, S with WebSockets] with RequestBuilder[WebSocketStreamRequest[T, S]] with Product with Serializable
Describes an HTTP WebSocket request.
Describes an HTTP WebSocket request. Either the request body, or the WebSocket handling uses non-blocking, asynchronous streams.
The request can be sent using an instance of WebSocketStreamBackend with the send method.
- T
The target type, to which the response body should be read. If the WebSocket interactions are described entirely by the response description, this might be
Unit
. Otherwise, this can be anS
stream of frames or mapped WebSocket messages.- S
The stream capability required to send this request, a subtype of Streams.
- response
Description of how the WebSocket 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.
-
case class
WebSocketStreamResponseAs[+T, S](delegate: GenericResponseAs[T, S with WebSockets]) extends ResponseAsDelegate[T, S with WebSockets] with Product with Serializable
Describes how the response of a WebSocketStreamRequest should be handled.
Describes how the response of a WebSocketStreamRequest should be handled.
The websocket response can be mapped over, to support custom types. The mapping can take into account the ResponseMetadata, that is the headers and status code. Responses can also be handled depending on the response metadata.
A number of
asWebSocket
helper methods are available as part of SttpApi and when importingsttp.client4._
.- T
Target type as which the response will be read.
-
trait
WebSocketSyncBackend extends SyncBackend with WebSocketBackend[Identity]
A GenericBackend which is synchronous (side effects are run directly), and supports web sockets.
Value Members
-
val
DefaultReadTimeout: Duration
- Definition Classes
- SttpApi
-
def
asBoth[A, B](l: ResponseAs[A], r: ResponseAs[B]): ResponseAs[(A, B)]
Use both
l
andr
to read the response body.Use both
l
andr
to read the response body. Neither response specifications may use streaming or web sockets.- Definition Classes
- SttpApi
-
def
asBothOption[A, B, S](l: StreamResponseAs[A, S], r: ResponseAs[B]): StreamResponseAs[(A, Option[B]), S]
Use
l
to read the response body.Use
l
to read the response body. If the raw body value which is used byl
is replayable (a file or byte array), also user
to read the response body. Otherwise ignorer
(if the raw body is a stream).- Definition Classes
- SttpApi
-
def
asBothOption[A, B](l: ResponseAs[A], r: ResponseAs[B]): ResponseAs[(A, Option[B])]
Use
l
to read the response body.Use
l
to read the response body. If the raw body value which is used byl
is replayable (a file or byte array), also user
to read the response body. Otherwise ignorer
(if the raw body is a stream).- Definition Classes
- SttpApi
-
def
asByteArray: ResponseAs[Either[String, Array[Byte]]]
- Definition Classes
- SttpApi
-
def
asByteArrayAlways: ResponseAs[Array[Byte]]
- Definition Classes
- SttpApi
-
def
asEither[A, B, S](onError: ResponseAs[A], onSuccess: StreamResponseAs[B, S]): StreamResponseAs[Either[A, B], S]
Uses the
onSuccess
response specification for successful responses (2xx), and theonError
specification otherwise.Uses the
onSuccess
response specification for successful responses (2xx), and theonError
specification otherwise.- Definition Classes
- SttpApi
-
def
asEither[A, B](onError: ResponseAs[A], onSuccess: ResponseAs[B]): ResponseAs[Either[A, B]]
Uses the
onSuccess
response specification for successful responses (2xx), and theonError
specification otherwise.Uses the
onSuccess
response specification for successful responses (2xx), and theonError
specification otherwise.- Definition Classes
- SttpApi
-
def
asFile(file: File): ResponseAs[Either[String, File]]
- Definition Classes
- SttpExtensions
-
def
asFileAlways(file: File): ResponseAs[File]
- Definition Classes
- SttpExtensions
-
def
asParams(charset: String): ResponseAs[Either[String, Seq[(String, String)]]]
Use the given charset by default, unless specified otherwise in the response headers.
Use the given charset by default, unless specified otherwise in the response headers.
- Definition Classes
- SttpApi
-
def
asParams: ResponseAs[Either[String, Seq[(String, String)]]]
Use the
utf-8
charset by default, unless specified otherwise in the response headers.Use the
utf-8
charset by default, unless specified otherwise in the response headers.- Definition Classes
- SttpApi
-
def
asParamsAlways(charset: String): ResponseAs[Seq[(String, String)]]
Use the given charset by default, unless specified otherwise in the response headers.
Use the given charset by default, unless specified otherwise in the response headers.
- Definition Classes
- SttpApi
-
def
asParamsAlways: ResponseAs[Seq[(String, String)]]
Use the
utf-8
charset by default, unless specified otherwise in the response headers.Use the
utf-8
charset by default, unless specified otherwise in the response headers.- Definition Classes
- SttpApi
-
def
asPath(path: Path): ResponseAs[Either[String, Path]]
- Definition Classes
- SttpExtensions
-
def
asPathAlways(path: Path): ResponseAs[Path]
- Definition Classes
- SttpExtensions
-
def
asStream[F[_], T, S](s: Streams[S])(f: (BinaryStream) ⇒ F[T]): StreamResponseAs[Either[String, T], S with Effect[F]]
- Definition Classes
- SttpApi
-
def
asStreamAlways[F[_], T, S](s: Streams[S])(f: (BinaryStream) ⇒ F[T]): StreamResponseAs[T, S with Effect[F]]
- Definition Classes
- SttpApi
-
def
asStreamAlwaysUnsafe[S](s: Streams[S]): StreamResponseAs[BinaryStream, S]
- Definition Classes
- SttpApi
-
def
asStreamAlwaysWithMetadata[F[_], T, S](s: Streams[S])(f: (BinaryStream, ResponseMetadata) ⇒ F[T]): StreamResponseAs[T, S with Effect[F]]
- Definition Classes
- SttpApi
-
def
asStreamUnsafe[S](s: Streams[S]): StreamResponseAs[Either[String, BinaryStream], S]
- Definition Classes
- SttpApi
-
def
asStreamWithMetadata[F[_], T, S](s: Streams[S])(f: (BinaryStream, ResponseMetadata) ⇒ F[T]): StreamResponseAs[Either[String, T], S with Effect[F]]
- Definition Classes
- SttpApi
-
def
asString(charset: String): ResponseAs[Either[String, String]]
Use the given charset by default, unless specified otherwise in the response headers.
Use the given charset by default, unless specified otherwise in the response headers.
- Definition Classes
- SttpApi
-
def
asString: ResponseAs[Either[String, String]]
Use the
utf-8
charset by default, unless specified otherwise in the response headers.Use the
utf-8
charset by default, unless specified otherwise in the response headers.- Definition Classes
- SttpApi
-
def
asStringAlways(charset: String): ResponseAs[String]
- Definition Classes
- SttpApi
-
def
asStringAlways: ResponseAs[String]
Use the
utf-8
charset by default, unless specified otherwise in the response headers.Use the
utf-8
charset by default, unless specified otherwise in the response headers.- Definition Classes
- SttpApi
-
val
basicRequest: PartialRequest[Either[String, String]]
A starting request, with the following modification comparing to emptyRequest:
Accept-Encoding
is set togzip, deflate
(compression/decompression is handled automatically by the library).A starting request, with the following modification comparing to emptyRequest:
Accept-Encoding
is set togzip, deflate
(compression/decompression is handled automatically by the library).Reads the response body as an
Either[String, String]
, whereLeft
is used if the status code is non-2xx, andRight
otherwise.- Definition Classes
- SttpApi
-
val
emptyRequest: PartialRequest[Either[String, String]]
An empty request with no headers.
An empty request with no headers.
Reads the response body as an
Either[String, String]
, whereLeft
is used if the status code is non-2xx, andRight
otherwise.- Definition Classes
- SttpApi
-
def
fromMetadata[T, S](default: ResponseAs[T], conditions: ConditionalResponseAs[StreamResponseAs[T, S]]*): StreamResponseAs[T, S]
- Definition Classes
- SttpApi
-
def
fromMetadata[T](default: ResponseAs[T], conditions: ConditionalResponseAs[ResponseAs[T]]*): ResponseAs[T]
- Definition Classes
- SttpApi
-
def
ignore: ResponseAs[Unit]
- Definition Classes
- SttpApi
-
def
multipart[B](name: String, b: B)(implicit arg0: BodySerializer[B]): Part[BasicBodyPart]
Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, fs: Seq[(String, String)], encoding: String): Part[BasicBodyPart]
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 thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, fs: Seq[(String, String)]): Part[BasicBodyPart]
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 thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, fs: Map[String, String], encoding: String): Part[BasicBodyPart]
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 thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, fs: Map[String, String]): Part[BasicBodyPart]
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 thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, data: InputStream): Part[BasicBodyPart]
Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, data: ByteBuffer): Part[BasicBodyPart]
Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, data: Array[Byte]): Part[BasicBodyPart]
Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, data: String, encoding: String): Part[BasicBodyPart]
Content type will be set to
text/plain
with given encoding, can be overridden later using thecontentType
method.Content type will be set to
text/plain
with given encoding, can be overridden later using thecontentType
method.- Definition Classes
- SttpApi
-
def
multipart(name: String, data: String): Part[BasicBodyPart]
Content type will be set to
text/plain
withutf-8
encoding, can be overridden later using thecontentType
method.Content type will be set to
text/plain
withutf-8
encoding, can be overridden later using thecontentType
method.- Definition Classes
- SttpApi
-
def
multipartFile(name: String, data: Path): Part[BasicBodyPart]
Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.File name will be set to the name of the file.
- Definition Classes
- SttpExtensions
-
def
multipartFile(name: String, data: File): Part[BasicBodyPart]
Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.File name will be set to the name of the file.
- Definition Classes
- SttpExtensions
-
def
multipartStream[S](s: Streams[S])(name: String, b: BinaryStream): Part[StreamBody[BinaryStream, S]]
Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.Content type will be set to
application/octet-stream
, can be overridden later using thecontentType
method.- Definition Classes
- SttpApi
-
val
quickRequest: PartialRequest[String]
A starting request which always reads the response body as a string, regardless of the status code.
A starting request which always reads the response body as a string, regardless of the status code.
- Definition Classes
- SttpApi
- object BackendOptions extends Serializable
- object BasicBody
- object DefaultFutureBackend
- object DefaultSyncBackend
- object GenericResponseAs
- object HttpError extends Serializable
- object IgnoreResponse extends GenericResponseAs[Unit, Any] with Product with Serializable
- object NoBody extends BasicBody with Product with Serializable
- object Request extends Serializable
- object Response extends Serializable
- object ResponseAs extends Serializable
- object ResponseAsByteArray extends GenericResponseAs[Array[Byte], Any] with Product with Serializable
- object ResponseAsStream extends Serializable
- object ResponseAsStreamUnsafe extends Serializable
- object RetryWhen
- object ShowError
- object StreamBody extends Serializable
- object SttpClientException extends SttpClientExceptionExtensions with Serializable
- object SttpExtensions
- object quick extends SttpApi