Package

com.softwaremill

sttp

Permalink

package sttp

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. sttp
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait BasicRequestBody extends RequestBody[Nothing]

    Permalink
  2. sealed trait BasicResponseAs[T, +S] extends ResponseAs[T, S]

    Permalink

    Response handling specification which isn't derived from another response handling method, but needs to be handled directly by the backend.

  3. type BodySerializer[B] = (B) ⇒ BasicRequestBody

    Permalink

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

  4. case class ByteArrayBody(b: Array[Byte], defaultContentType: Option[String] = ...) extends BasicRequestBody with Product with Serializable

    Permalink
  5. case class ByteBufferBody(b: ByteBuffer, defaultContentType: Option[String] = ...) extends BasicRequestBody with Product with Serializable

    Permalink
  6. case class Cookie(name: String, value: String, expires: Option[ZonedDateTime] = None, maxAge: Option[Long] = None, domain: Option[String] = None, path: Option[String] = None, secure: Boolean = false, httpOnly: Boolean = false) extends Product with Serializable

    Permalink
  7. type Empty[X] = None.type

    Permalink
  8. class FollowRedirectsBackend[R[_], S] extends SttpBackend[R, S]

    Permalink
  9. class FutureMonad extends MonadAsyncError[Future]

    Permalink
  10. class HttpURLConnectionBackend extends SttpBackend[Id, Nothing]

    Permalink
  11. type Id[X] = X

    Permalink
  12. case class InputStreamBody(b: InputStream, defaultContentType: Option[String] = ...) extends BasicRequestBody with Product with Serializable

    Permalink
  13. case class MappedResponseAs[T, T2, S](raw: BasicResponseAs[T, S], g: (T) ⇒ T2) extends ResponseAs[T2, S] with Product with Serializable

    Permalink
  14. final case class Method(m: String) extends AnyVal with Product with Serializable

    Permalink
  15. trait MonadAsyncError[R[_]] extends MonadError[R]

    Permalink
  16. trait MonadError[R[_]] extends AnyRef

    Permalink
  17. case class Multipart(name: String, body: BasicRequestBody, fileName: Option[String] = None, contentType: Option[String] = None, additionalHeaders: Map[String, String] = Map()) extends Product with Serializable

    Permalink

    Use the factory methods multipart to conveniently create instances of this class.

    Use the factory methods multipart to conveniently create instances of this class. A part can be then further customised using fileName, contentType and header methods.

  18. case class MultipartBody(parts: Seq[Multipart]) extends RequestBody[Nothing] with Product with Serializable

    Permalink
  19. type PartialRequest[T, +S] = RequestT[Empty, T, S]

    Permalink
  20. case class PathBody(f: Path, defaultContentType: Option[String] = ...) extends BasicRequestBody with Product with Serializable

    Permalink
  21. type Request[T, +S] = RequestT[Id, T, S]

    Permalink
  22. sealed trait RequestBody[+S] extends AnyRef

    Permalink
  23. case class RequestOptions(followRedirects: Boolean, readTimeout: Duration) extends Product with Serializable

    Permalink
  24. case class RequestT[U[_], T, +S](method: U[Method], uri: U[Uri], body: RequestBody[S], headers: Seq[(String, String)], response: ResponseAs[T, S], options: RequestOptions, tags: Map[String, Any]) extends Product with Serializable

    Permalink

    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. * Id, which is an identity type constructor. This type of request is aliased to Request: the method and uri are specified, and the request can be sent.

    response

    What's the target type to which the response body should be read. Needs to be specified upfront so that the response is always consumed and hence there are no requirements on client code to consume it. An exception to this are streaming responses, which need to fully consumed by the client if such a response type is requested.

    tags

    Request-specific tags which can be used by backends for logging, metrics, etc. Not used by default.

  25. case class Response[T](body: Either[String, T], code: Int, statusText: String, headers: Seq[(String, String)], history: List[Response[Unit]]) extends Product with Serializable

    Permalink

    body

    Right(T), if the request was successful (status code 2xx). The body is then handled as specified in the request. Left(String), if the request wasn't successful (status code 3xx, 4xx or 5xx). In this case, the response body is read into a String.

    history

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

  26. sealed trait ResponseAs[T, +S] extends AnyRef

    Permalink

    T

    Target type as which the response will be read.

    S

    If T is a stream, the type of the stream. Otherwise, Nothing.

  27. case class ResponseAsFile(output: File, overwrite: Boolean) extends BasicResponseAs[File, Nothing] with Product with Serializable

    Permalink
  28. case class ResponseAsStream[T, S]()(implicit responseIsStream: =:=[S, T]) extends BasicResponseAs[T, S] with Product with Serializable

    Permalink
  29. case class ResponseAsString(encoding: String) extends BasicResponseAs[String, Nothing] with Product with Serializable

    Permalink
  30. class SpecifyAuthScheme[U[_], T, +S] extends AnyRef

    Permalink
  31. case class StreamBody[S](s: S) extends RequestBody[S] with Product with Serializable

    Permalink
  32. case class StringBody(s: String, encoding: String, defaultContentType: Option[String] = Some(TextPlainContentType)) extends BasicRequestBody with Product with Serializable

    Permalink
  33. trait SttpBackend[R[_], -S] extends AnyRef

    Permalink

    R

    The type constructor in which responses are wrapped. E.g. Id for synchronous backends, Future for asynchronous backends.

    S

    The type of streams that are supported by the backend. Nothing, if streaming requests/responses is not supported by this backend.

  34. case class SttpBackendOptions(connectionTimeout: FiniteDuration, proxy: Option[Proxy]) extends Product with Serializable

    Permalink
  35. class TryBackend[-S] extends SttpBackend[Try, S]

    Permalink

    A Backend that safely wraps SttpBackend exceptions in Try's

    A Backend that safely wraps SttpBackend exceptions in Try's

    S

    The type of streams that are supported by the backend. Nothing, if streaming requests/responses is not supported by this backend.

  36. case class Uri(scheme: String, userInfo: Option[UserInfo], host: String, port: Option[Int], path: Seq[String], queryFragments: Seq[QueryFragment], fragment: Option[String]) extends Product with Serializable

    Permalink

    A URI.

    A URI. All components (scheme, host, query, ...) are stored unencoded, and become encoded upon serialization (using toString).

    queryFragments

    Either key-value pairs, single values, or plain query fragments. Key value pairs will be serialized as k=v, and blocks of key-value pairs/single values will be combined using &. Note that no & or other separators are added around plain query fragments - if required, they need to be added manually as part of the plain query fragment.

  37. implicit final class UriContext extends AnyVal

    Permalink

Value Members

  1. object Cookie extends Serializable

    Permalink
  2. val DefaultReadTimeout: Duration

    Permalink
  3. object FollowRedirectsBackend

    Permalink
  4. object HttpURLConnectionBackend

    Permalink
  5. object IdMonad extends MonadError[Id]

    Permalink
  6. object IgnoreResponse extends BasicResponseAs[Unit, Nothing] with Product with Serializable

    Permalink
  7. object Method extends Serializable

    Permalink
  8. object NoBody extends RequestBody[Nothing] with Product with Serializable

    Permalink
  9. object RequestBody

    Permalink
  10. object ResponseAs

    Permalink
  11. object ResponseAsByteArray extends BasicResponseAs[Array[Byte], Nothing] with Product with Serializable

    Permalink
  12. object SttpBackendOptions extends Serializable

    Permalink
  13. object TryHttpURLConnectionBackend

    Permalink
  14. object TryMonad extends MonadError[Try]

    Permalink
  15. object Uri extends Serializable

    Permalink
  16. object UriInterpolator

    Permalink
  17. def asByteArray: ResponseAs[Array[Byte], Nothing]

    Permalink
  18. def asFile(file: File, overwrite: Boolean = false): ResponseAs[File, Nothing]

    Permalink
  19. def asParams(encoding: String): ResponseAs[Seq[(String, String)], Nothing]

    Permalink

    Use the given encoding by default, unless specified otherwise in the response headers.

  20. def asParams: ResponseAs[Seq[(String, String)], Nothing]

    Permalink

    Use the utf-8 encoding by default, unless specified otherwise in the response headers.

  21. def asPath(path: Path, overwrite: Boolean = false): ResponseAs[Path, Nothing]

    Permalink
  22. def asStream[S]: ResponseAs[S, S]

    Permalink
  23. def asString(encoding: String): ResponseAs[String, Nothing]

    Permalink

    Use the given encoding by default, unless specified otherwise in the response headers.

  24. def asString: ResponseAs[String, Nothing]

    Permalink

    Use the utf-8 encoding by default, unless specified otherwise in the response headers.

  25. val emptyRequest: RequestT[Empty, String, Nothing]

    Permalink

    An empty request with no headers.

  26. def ignore: ResponseAs[Unit, Nothing]

    Permalink
  27. def multipart[B](name: String, b: B)(implicit arg0: BodySerializer[B]): Multipart

    Permalink

    Content type will be set to application/octet-stream, can be overridden later using the contentType method.

  28. def multipart(name: String, fs: Seq[(String, String)], encoding: String): Multipart

    Permalink

    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.

  29. def multipart(name: String, fs: Seq[(String, String)]): Multipart

    Permalink

    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.

  30. def multipart(name: String, fs: Map[String, String], encoding: String): Multipart

    Permalink

    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.

  31. def multipart(name: String, fs: Map[String, String]): Multipart

    Permalink

    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.

  32. def multipart(name: String, data: Path): Multipart

    Permalink

    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.

  33. def multipart(name: String, data: File): Multipart

    Permalink

    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.

  34. def multipart(name: String, data: InputStream): Multipart

    Permalink

    Content type will be set to application/octet-stream, can be overridden later using the contentType method.

  35. def multipart(name: String, data: ByteBuffer): Multipart

    Permalink

    Content type will be set to application/octet-stream, can be overridden later using the contentType method.

  36. def multipart(name: String, data: Array[Byte]): Multipart

    Permalink

    Content type will be set to application/octet-stream, can be overridden later using the contentType method.

  37. def multipart(name: String, data: String, encoding: String): Multipart

    Permalink

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

  38. def multipart(name: String, data: String): Multipart

    Permalink

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

  39. val sttp: RequestT[Empty, String, Nothing]

    Permalink

    A starting request, with the following modifications comparing to emptyRequest:

    A starting request, with the following modifications comparing to emptyRequest:

    - Accept-Encoding set to gzip, deflate (handled automatically by the library)

  40. package testing

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped