sttp.client3

package sttp.client3

Members list

Concise view

Type members

Classlikes

sealed trait BasicRequestBody extends RequestBody[Any]

Attributes

Graph
Supertypes
trait RequestBody[Any]
class Object
trait Matchable
class Any
Known subtypes
case class ByteArrayBody(b: Array[Byte], defaultContentType: MediaType) extends BasicRequestBody

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestBody[Any]
class Object
trait Matchable
class Any
case class ByteBufferBody(b: ByteBuffer, defaultContentType: MediaType) extends BasicRequestBody

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestBody[Any]
class Object
trait Matchable
class Any
case class ConditionalResponseAs[+T, R](condition: ResponseMetadata => Boolean, responseAs: ResponseAs[T, R])

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
abstract class DelegateSttpBackend[F[_], +P](delegate: SttpBackend[F, P]) extends SttpBackend[F, P]

A base class for delegate backends, which includes delegating implementations for close and responseMonad, so that only send needs to be defined.

A base class for delegate backends, which includes delegating implementations for close and responseMonad, so that only send needs to be defined.

Attributes

Graph
Supertypes
trait SttpBackend[F, P]
class Object
trait Matchable
class Any
Known subtypes
case class DeserializationException[DE](body: String, error: DE)(implicit evidence$1: ShowError[DE]) extends ResponseException[Nothing, DE]

Attributes

Graph
Supertypes
trait Product
trait Equals
class ResponseException[Nothing, DE]
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
class DigestAuthenticationBackend[F[_], P](delegate: SttpBackend[F, P], clientNonceGenerator: () => String) extends DelegateSttpBackend[F, P]

Attributes

Companion:
object
Graph
Supertypes
trait SttpBackend[F, P]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class EitherBackend[P](delegate: SttpBackend[Identity, P]) extends SttpBackend[[_] =>> Either[Throwable, _$1], P]

A synchronous backend that safely wraps SttpBackend exceptions in Either[Throwable, *]'s

A synchronous backend that safely wraps SttpBackend exceptions in Either[Throwable, *]'s

Attributes

P

TODO

delegate

A synchronous SttpBackend which to which this backend forwards all requests

Graph
Supertypes
trait SttpBackend[[_] =>> Either[Throwable, _$1], P]
class Object
trait Matchable
class Any
case class FileBody(f: SttpFile, defaultContentType: MediaType) extends BasicRequestBody

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestBody[Any]
class Object
trait Matchable
class Any
class FollowRedirectsBackend[F[_], P](delegate: SttpBackend[F, P], contentHeaders: Set[String], sensitiveHeaders: Set[String], transformUri: Uri => Uri) extends DelegateSttpBackend[F, P]

Attributes

transformUri

Defines if and how Uri s from the Location header should be transformed. For example, this enables changing the encoding of host, path, query and fragment segments to be more strict or relaxed.

Companion:
object
Graph
Supertypes
trait SttpBackend[F, P]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
abstract class HttpClientAsyncBackend[F[_], S, P, BH, B](client: HttpClient, monad: MonadAsyncError[F], closeClient: Boolean, customizeRequest: HttpRequest => HttpRequest, customEncodingHandler: EncodingHandler[B]) extends HttpClientBackend[F, S, P, B]

Attributes

B

The higher-level body to which BH is transformed (e.g. a backend-native stream representation), which then is used to read the body as described by responseAs.

BH

The low-level type of the body, read using a HttpResponse.BodyHandler read by HttpClient.

F

The effect type

P

Capabilities supported by the backend. See SttpBackend.

S

Type of supported byte streams, Nothing if none

Graph
Supertypes
class HttpClientBackend[F, S, P, B]
trait SttpBackend[F, P]
class Object
trait Matchable
class Any
Known subtypes
abstract class HttpClientBackend[F[_], S, P, B](client: HttpClient, closeClient: Boolean, customEncodingHandler: EncodingHandler[B]) extends SttpBackend[F, P]

Attributes

closeClient

If the executor underlying the client is a ThreadPoolExecutor, should it be shutdown on close.

Companion:
object
Graph
Supertypes
trait SttpBackend[F, P]
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class HttpClientFutureBackend extends HttpClientAsyncBackend[Future, Nothing, WebSockets, InputStream, InputStream]

Attributes

Companion:
object
Graph
Supertypes
class HttpClientAsyncBackend[Future, Nothing, WebSockets, InputStream, InputStream]
class HttpClientBackend[Future, Nothing, WebSockets, InputStream]
trait SttpBackend[Future, WebSockets]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
class HttpClientSyncBackend extends HttpClientBackend[Identity, Nothing, Any, InputStream]

Attributes

Companion:
object
Graph
Supertypes
class HttpClientBackend[Identity, Nothing, Any, InputStream]
trait SttpBackend[Identity, Any]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class HttpError[HE](body: HE, statusCode: StatusCode) extends ResponseException[HE, Nothing]

Attributes

Companion:
object
Graph
Supertypes
trait Product
trait Equals
class ResponseException[HE, Nothing]
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
object HttpError

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
object
Graph
Supertypes
trait SttpBackend[Identity, Any]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case object IgnoreResponse extends ResponseAs[Unit, Any]

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ResponseAs[Unit, Any]
class Object
trait Matchable
class Any
Self type
case class InputStreamBody(b: InputStream, defaultContentType: MediaType) extends BasicRequestBody

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestBody[Any]
class Object
trait Matchable
class Any
case class MappedResponseAs[T, T2, R](raw: ResponseAs[T, R], g: (T, ResponseMetadata) => T2, showAs: Option[String]) extends ResponseAs[T2, R]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseAs[T2, R]
class Object
trait Matchable
class Any
case class MultipartBody[R](parts: Seq[Part[RequestBody[R]]]) extends RequestBody[R]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestBody[R]
class Object
trait Matchable
class Any
case object NoBody extends RequestBody[Any]

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait RequestBody[Any]
class Object
trait Matchable
class Any
Self type
NoBody.type
sealed trait RequestBody[-R]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class FileBody
class MultipartBody[R]
object NoBody.type
class StreamBody[BinaryStream, S]

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RequestOptions(followRedirects: Boolean, readTimeout: Duration, maxRedirects: Int, redirectToGet: Boolean)

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
case class RequestT[U[_], T, -R](method: U[Method], uri: U[Uri], body: RequestBody[R], headers: Seq[Header], response: ResponseAs[T, R], options: RequestOptions, tags: Map[String, Any]) extends HasHeaders with RequestTExtensions[U, T, R]

Describes a HTTP request, along with a description of how the response body should be handled.

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.

Attributes

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.

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.

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestTExtensions[U, T, R]
trait HasHeaders
class Object
trait Matchable
class Any
object RequestT

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait RequestTExtensions[U[_], T, -R]

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class RequestT[U, T, R]
Self type
RequestT[U, T, R]
class ResolveRelativeUrisBackend[F[_], +P](delegate: SttpBackend[F, P], resolve: Uri => F[Uri]) extends DelegateSttpBackend[F, P]

Attributes

Companion:
object
Graph
Supertypes
trait SttpBackend[F, P]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class Response[T](body: T, code: StatusCode, statusText: String, headers: Seq[Header], history: List[Response[Unit]], request: RequestMetadata) extends ResponseMetadata

Attributes

history

If redirects are followed, and there were redirects, contains responses for the intermediate requests. The first response (oldest) comes first.

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseMetadata
trait HasHeaders
class Object
trait Matchable
class Any
object Response

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ResponseAs[+T, -R]

Describes how response body should be handled.

Describes how response body 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 importing sttp.client3._.

Attributes

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).

T

Target type as which the response will be read.

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object IgnoreResponse.type
class MappedResponseAs[T, T2, R]
class ResponseAsBoth[A, B, R]
class ResponseAsStream[F, T, Stream, S]
class ResponseAsStreamUnsafe[BinaryStream, S]
object ResponseAs

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ResponseAsBoth[A, B, R](l: ResponseAs[A, R], r: ResponseAs[B, Any]) extends ResponseAs[(A, Option[B]), R]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseAs[(A, Option[B]), R]
class Object
trait Matchable
class Any
case object ResponseAsByteArray extends ResponseAs[Array[Byte], Any]

Attributes

Graph
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait ResponseAs[Array[Byte], Any]
class Object
trait Matchable
class Any
Self type
case class ResponseAsFile(output: SttpFile) extends ResponseAs[SttpFile, Any]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseAs[SttpFile, Any]
class Object
trait Matchable
class Any
case class ResponseAsFromMetadata[T, R](conditions: List[ConditionalResponseAs[T, R]], default: ResponseAs[T, R]) extends ResponseAs[T, R]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseAs[T, R]
class Object
trait Matchable
class Any
case class ResponseAsStream[F[_], T, Stream, S] extends ResponseAs[T, Effect[F] & S]

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseAs[T, Effect[F] & S]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ResponseAsStreamUnsafe[BinaryStream, S] extends ResponseAs[BinaryStream, S]

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait ResponseAs[BinaryStream, S]
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ResponseAsWebSocket[F[_], T](f: (WebSocket[F], ResponseMetadata) => F[T]) extends WebSocketResponseAs[T, Effect[F] & WebSockets]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait WebSocketResponseAs[T, Effect[F] & WebSockets]
trait ResponseAs[T, Effect[F] & WebSockets]
class Object
trait Matchable
class Any
case class ResponseAsWebSocketStream[S, Pipe[_, _]](s: Streams[S], p: Pipe[Data[_], WebSocketFrame]) extends WebSocketResponseAs[Unit, S & WebSockets]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait WebSocketResponseAs[Unit, S & WebSockets]
trait ResponseAs[Unit, S & WebSockets]
class Object
trait Matchable
class Any
case class ResponseAsWebSocketUnsafe[F[_]]() extends WebSocketResponseAs[WebSocket[F], Effect[F] & WebSockets]

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait WebSocketResponseAs[WebSocket[F], Effect[F] & WebSockets]
trait ResponseAs[WebSocket[F], Effect[F] & WebSockets]
class Object
trait Matchable
class Any
sealed abstract class ResponseException[+HE, +DE](error: String) extends Exception

Attributes

Graph
Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object RetryWhen

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
trait ShowError[-T]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
object ShowError

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class SimpleHttpClient(backend: SttpBackend[Identity, Any])

A simple, synchronous http client. Usage example:

A simple, synchronous http client. Usage example:

import sttp.client3.{SimpleHttpClient, UriContext, basicRequest}

val client = SimpleHttpClient()
val request = basicRequest.get(uri"https://httpbin.org/get")
val response = client.send(request)
println(response.body)

Wraps an SttpBackend, which can be substituted or modified using wrapBackend, adding e.g. logging.

Creating a client allocates resources, hence when no longer needed, the client should be closed using close.

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
class SpecifyAuthScheme[U[_], T, -R](hn: String, rt: RequestT[U, T, R], digestTag: String)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
case class StreamBody[BinaryStream, S] extends RequestBody[S]

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestBody[S]
class Object
trait Matchable
class Any
object StreamBody

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class StringBody(s: String, encoding: String, defaultContentType: MediaType) extends BasicRequestBody

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RequestBody[Any]
class Object
trait Matchable
class Any
trait SttpApi extends SttpExtensions with UriInterpolator

Attributes

Graph
Supertypes
trait UriInterpolator
class Object
trait Matchable
class Any
Known subtypes
object quick.type
trait SttpBackend[F[_], +P]

A backend is used to send HTTP requests described by RequestT. Backends might wrap Java or Scala HTTP clients, or other backends.

A backend is used to send HTTP requests described by RequestT. Backends might wrap Java or Scala HTTP clients, or other backends.

Attributes

F

The effect type used when returning responses. 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), Streams (the ability to send and receive streaming bodies) or WebSockets (the ability to handle websocket requests).

Note:

Backends should try to classify exceptions into one of the categories specified by SttpClientException. Other exceptions should be thrown unchanged.

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class SttpBackendOptions(connectionTimeout: FiniteDuration, proxy: Option[Proxy])

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
abstract class SttpClientException(val request: RequestT[Identity, _, _], val cause: Exception) extends Exception

Known exceptions that might occur when using a backend. Currently this covers:

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 SttpBackend.send methods might also throw other exceptions, due to programming errors, bugs in the underlying implementations, bugs in sttp or an uncovered exception.

Attributes

cause

The original exception.

request

The request, which was being sent when the exception was thrown

Companion:
object
Graph
Supertypes
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait SttpApi
object quick.type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
case class TooManyRedirectsException(uri: Uri, redirects: Int) extends Exception

Attributes

Graph
Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
class TryBackend[P](delegate: SttpBackend[Identity, P]) extends SttpBackend[Try, P]

A synchronous backend that safely wraps SttpBackend exceptions in Try's

A synchronous backend that safely wraps SttpBackend exceptions in Try's

Attributes

P

TODO

delegate

A synchronous SttpBackend which to which this backend forwards all requests

Graph
Supertypes
trait SttpBackend[Try, P]
class Object
trait Matchable
class Any

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait WebSocketResponseAs[T, -R] extends ResponseAs[T, R]

Attributes

Graph
Supertypes
trait ResponseAs[T, R]
class Object
trait Matchable
class Any
Known subtypes
object quick extends SttpApi

Attributes

Graph
Supertypes
trait SttpApi
trait UriInterpolator
class Object
trait Matchable
class Any
Self type
quick.type

Inherited classlikes

implicit class UriContext(val sc: StringContext)

Attributes

Inherited from:
UriInterpolator
Graph
Supertypes
class Object
trait Matchable
class Any

Types

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).

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).

Attributes

type Empty[X] = None.type
type Identity[X] = X
type PartialRequest[T, -R] = RequestT[Empty, T, R]

A RequestT without the method & uri specified (which cannot yet be sent).

A RequestT without the method & uri specified (which cannot yet be sent).

Attributes

type Request[T, -R] = RequestT[Identity, T, R]

A RequestT with the method & uri specified. Such a request can be sent.

A RequestT with the method & uri specified. Such a request can be sent.

Attributes

type RetryWhen = (RequestT[Identity, _, _], Either[Throwable, Response[_]]) => Boolean

Deprecated types

Attributes

Deprecated
[Since version 3.0.0] use DeserializationException
type ResponseError[+HE, +DE] = ResponseException[HE, DE]

Attributes

Deprecated
[Since version 3.0.0] use ResponseException

Value members

Inherited methods

def asBoth[A, B](l: ResponseAs[A, Any], r: ResponseAs[B, Any]): ResponseAs[(A, B), Any]

Use both l and r to read the response body. Neither response specifications may use streaming or web sockets.

Use both l and r to read the response body. Neither response specifications may use streaming or web sockets.

Attributes

Inherited from:
SttpApi
def asBothOption[A, B, R](l: ResponseAs[A, R], r: ResponseAs[B, Any]): ResponseAs[(A, Option[B]), R]

Use l to read the response body. If the raw body value which is used by l is replayable (a file or byte array), also use r to read the response body. Otherwise ignore r (if the raw body is a stream or a web socket).

Use l to read the response body. If the raw body value which is used by l is replayable (a file or byte array), also use r to read the response body. Otherwise ignore r (if the raw body is a stream or a web socket).

Attributes

Inherited from:
SttpApi
def asByteArray: ResponseAs[Either[String, Array[Byte]], Any]

Attributes

Inherited from:
SttpApi
def asByteArrayAlways: ResponseAs[Array[Byte], Any]

Attributes

Inherited from:
SttpApi
def asEither[A, B, R](onError: ResponseAs[A, R], onSuccess: ResponseAs[B, R]): ResponseAs[Either[A, B], R]

Uses the onSuccess response specification for successful responses (2xx), and the onError specification otherwise.

Uses the onSuccess response specification for successful responses (2xx), and the onError specification otherwise.

Attributes

Inherited from:
SttpApi
def asFile(file: File): ResponseAs[Either[String, File], Any]

Attributes

Inherited from:
SttpExtensions
def asFileAlways(file: File): ResponseAs[File, Any]

Attributes

Inherited from:
SttpExtensions
def asParams(charset: String): ResponseAs[Either[String, Seq[(String, String)]], Any]

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.

Attributes

Inherited from:
SttpApi
def asParams: ResponseAs[Either[String, Seq[(String, String)]], Any]

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.

Attributes

Inherited from:
SttpApi
def asParamsAlways(charset: String): ResponseAs[Seq[(String, String)], Any]

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.

Attributes

Inherited from:
SttpApi
def asParamsAlways: ResponseAs[Seq[(String, String)], Any]

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.

Attributes

Inherited from:
SttpApi
def asPath(path: Path): ResponseAs[Either[String, Path], Any]

Attributes

Inherited from:
SttpExtensions
def asPathAlways(path: Path): ResponseAs[Path, Any]

Attributes

Inherited from:
SttpExtensions
def asStream[F[_], T, S](s: Streams[S])(f: BinaryStream => F[T]): ResponseAs[Either[String, T], Effect[F] & S]

Attributes

Inherited from:
SttpApi
def asStreamAlways[F[_], T, S](s: Streams[S])(f: BinaryStream => F[T]): ResponseAs[T, Effect[F] & S]

Attributes

Inherited from:
SttpApi
def asStreamAlwaysUnsafe[S](s: Streams[S]): ResponseAs[BinaryStream, S]

Attributes

Inherited from:
SttpApi
def asStreamAlwaysWithMetadata[F[_], T, S](s: Streams[S])(f: (BinaryStream, ResponseMetadata) => F[T]): ResponseAs[T, Effect[F] & S]

Attributes

Inherited from:
SttpApi
def asStreamUnsafe[S](s: Streams[S]): ResponseAs[Either[String, BinaryStream], S]

Attributes

Inherited from:
SttpApi
def asStreamWithMetadata[F[_], T, S](s: Streams[S])(f: (BinaryStream, ResponseMetadata) => F[T]): ResponseAs[Either[String, T], Effect[F] & S]

Attributes

Inherited from:
SttpApi
def asString(charset: String): ResponseAs[Either[String, String], Any]

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.

Attributes

Inherited from:
SttpApi
def asString: ResponseAs[Either[String, String], Any]

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.

Attributes

Inherited from:
SttpApi
def asStringAlways(charset: String): ResponseAs[String, Any]

Attributes

Inherited from:
SttpApi
def asStringAlways: ResponseAs[String, Any]

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.

Attributes

Inherited from:
SttpApi
def asWebSocket[F[_], T](f: WebSocket[F] => F[T]): ResponseAs[Either[String, T], Effect[F] & WebSockets]

Attributes

Inherited from:
SttpApi
def asWebSocketAlways[F[_], T](f: WebSocket[F] => F[T]): ResponseAs[T, Effect[F] & WebSockets]

Attributes

Inherited from:
SttpApi
def asWebSocketAlwaysUnsafe[F[_]]: ResponseAs[WebSocket[F], Effect[F] & WebSockets]

Attributes

Inherited from:
SttpApi
def asWebSocketAlwaysWithMetadata[F[_], T](f: (WebSocket[F], ResponseMetadata) => F[T]): ResponseAs[T, Effect[F] & WebSockets]

Attributes

Inherited from:
SttpApi
def asWebSocketEither[A, B, R](onError: ResponseAs[A, R], onSuccess: ResponseAs[B, R]): ResponseAs[Either[A, B], R]

Uses the onSuccess response specification for 101 responses (switching protocols) on JVM/Native, 200 responses on JS. Otherwise, use the onError specification.

Uses the onSuccess response specification for 101 responses (switching protocols) on JVM/Native, 200 responses on JS. Otherwise, use the onError specification.

Attributes

Inherited from:
SttpApi
def asWebSocketStream[S](s: Streams[S])(p: Pipe[Data[_], WebSocketFrame]): ResponseAs[Either[String, Unit], S & WebSockets]

Attributes

Inherited from:
SttpApi
def asWebSocketStreamAlways[S](s: Streams[S])(p: Pipe[Data[_], WebSocketFrame]): ResponseAs[Unit, S & WebSockets]

Attributes

Inherited from:
SttpApi
def asWebSocketUnsafe[F[_]]: ResponseAs[Either[String, WebSocket[F]], Effect[F] & WebSockets]

Attributes

Inherited from:
SttpApi
def asWebSocketWithMetadata[F[_], T](f: (WebSocket[F], ResponseMetadata) => F[T]): ResponseAs[Either[String, T], Effect[F] & WebSockets]

Attributes

Inherited from:
SttpApi
def fromMetadata[T, R](default: ResponseAs[T, R], conditions: ConditionalResponseAs[T, R]*): ResponseAs[T, R]

Attributes

Inherited from:
SttpApi
def ignore: ResponseAs[Unit, Any]

Attributes

Inherited from:
SttpApi
def multipart[B : BodySerializer](name: String, b: B): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, fs: Seq[(String, String)], encoding: String): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, fs: Seq[(String, String)]): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, fs: Map[String, String], encoding: String): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, fs: Map[String, String]): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, data: InputStream): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, data: ByteBuffer): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, data: Array[Byte]): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipart(name: String, data: String, encoding: String): Part[BasicRequestBody]

Content type will be set to text/plain with given encoding, can be overridden later using the contentType method.

Content type will be set to text/plain with given encoding, can be overridden later using the contentType method.

Attributes

Inherited from:
SttpApi
def multipart(name: String, data: String): Part[BasicRequestBody]

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.

Attributes

Inherited from:
SttpApi
def multipartFile(name: String, data: Path): Part[RequestBody[Any]]

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.

Attributes

Inherited from:
SttpExtensions
def multipartFile(name: String, data: File): Part[RequestBody[Any]]

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.

Attributes

Inherited from:
SttpExtensions
def multipartStream[S](s: Streams[S])(name: String, b: BinaryStream): Part[RequestBody[S]]

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.

Attributes

Inherited from:
SttpApi

Inherited fields

val DefaultReadTimeout: Duration

Attributes

Inherited from:
SttpApi
val basicRequest: RequestT[Empty, Either[String, String], Any]

A starting request, with the following modification comparing to emptyRequest: Accept-Encoding is set to gzip, deflate (compression/decompression is handled automatically by the library).

A starting request, with the following modification comparing to emptyRequest: Accept-Encoding is set to gzip, deflate (compression/decompression is handled automatically by the library).

Reads the response body as an Either[String, String], where Left is used if the status code is non-2xx, and Right otherwise.

Attributes

Inherited from:
SttpApi
val emptyRequest: RequestT[Empty, Either[String, String], Any]

An empty request with no headers.

An empty request with no headers.

Reads the response body as an Either[String, String], where Left is used if the status code is non-2xx, and Right otherwise.

Attributes

Inherited from:
SttpApi
val quickRequest: RequestT[Empty, String, Any]

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.

Attributes

Inherited from:
SttpApi

Implicits

Inherited implicits

final implicit def UriContext(sc: StringContext): UriContext

Attributes

Inherited from:
UriInterpolator