Packages

t

sttp.client4

GenericBackend

trait GenericBackend[F[_], +P] extends AnyRef

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.

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

Abstract Value Members

  1. abstract def close(): F[Unit]

    Close the backend, releasing any resources (such as thread or connection pools) that have been allocated when opening or using the backend.

  2. abstract def monad: MonadError[F]

    A monad instance for the F effect type.

    A monad instance for the F effect type. Allows writing wrapper backends, which map/flatMap over the return value of send.

  3. abstract def send[T](request: GenericRequest[T, P with Effect[F]]): F[Response[T]]

    Send the given request.

    Send the given request. Should only be used when implementing new backends, or backend wrappers. Client code should instead use the send methods on the request type, e.g. Request.send.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  15. def toString(): String
    Definition Classes
    AnyRef → Any
  16. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  17. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped