Packages

trait Client[F[_]] extends AnyRef

A Client submits Requests to a server and processes the Response.

When a connection is "released" and the HTTP semantics of the request and response permit, the connection may be kept alive by the backend and used for a subsequent request. When HTTP semantics require it, or at the backend's discretion, a released connection may also be closed.

Source
Client.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Client
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def expect[A](s: String)(implicit d: EntityDecoder[F, A]): F[A]

    Submits a GET request to the URI specified by the String and decodes the response on success.

    Submits a GET request to the URI specified by the String and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is released at the completion of the decoding.

  2. abstract def expect[A](uri: Uri)(implicit d: EntityDecoder[F, A]): F[A]

    Submits a GET request to the specified URI and decodes the response on success.

    Submits a GET request to the specified URI and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is released at the completion of the decoding.

  3. abstract def expect[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[A]

    Submits a request and decodes the response on success.

    Submits a request and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is released at the completion of the decoding.

  4. abstract def expectOption[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[Option[A]]
  5. abstract def expectOptionOr[A](req: Request[F])(onError: (Response[F]) => F[Throwable])(implicit d: EntityDecoder[F, A]): F[Option[A]]
  6. abstract def expectOr[A](s: String)(onError: (Response[F]) => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
  7. abstract def expectOr[A](uri: Uri)(onError: (Response[F]) => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
  8. abstract def expectOr[A](req: F[Request[F]])(onError: (Response[F]) => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
  9. abstract def expectOr[A](req: Request[F])(onError: (Response[F]) => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
  10. abstract def fetchAs[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[A]

    Submits a request and decodes the response, regardless of the status code.

    Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is released at the completion of the decoding.

  11. abstract def get[A](s: String)(f: (Response[F]) => F[A]): F[A]

    Submits a request and decodes the response on success.

    Submits a request and decodes the response on success. On failure, the status code is returned. The underlying HTTP connection is released at the completion of the decoding.

  12. abstract def get[A](uri: Uri)(f: (Response[F]) => F[A]): F[A]

    Submits a GET request, and provides a callback to process the response.

    Submits a GET request, and provides a callback to process the response.

    uri

    The URI to GET

    f

    A callback for the response to a GET on uri. The underlying HTTP connection is released when the returned task completes. Attempts to read the response body afterward will result in an error.

    returns

    The result of applying f to the response to req

  13. abstract def run(req: Request[F]): Resource[F, Response[F]]
  14. abstract def status(req: Request[F]): F[Status]

    Submits a request and returns the response status

  15. abstract def statusFromString(s: String): F[Status]

    Submits a GET request to the URI and returns the response status

  16. abstract def statusFromUri(uri: Uri): F[Status]

    Submits a GET request to the URI and returns the response status

  17. abstract def stream(req: Request[F]): Stream[F, Response[F]]

    Run the request as a stream.

    Run the request as a stream. The response lifecycle is equivalent to the returned Stream's.

  18. abstract def successful(req: Request[F]): F[Boolean]

    Submits a request and returns true if and only if the response status is successful

  19. abstract def toHttpApp: HttpApp[F]

    Returns this client as an HttpApp.

    Returns this client as an HttpApp. It is the responsibility of callers of this service to run the response body to release the underlying HTTP connection.

    This is intended for use in proxy servers. run, fetchAs[A](req:org\.http4s\.Request[F])*, toKleisli, and stream are safer alternatives, as their signatures guarantee release of the HTTP connection.

  20. abstract def toKleisli[A](f: (Response[F]) => F[A]): Kleisli[F, Request[F], A]

    Returns this client as a cats.data.Kleisli.

    Returns this client as a cats.data.Kleisli. All connections created by this service are released on completion of callback task f.

    This method effectively reverses the arguments to run followed by use, and is preferred when an HTTP client is composed into a larger Kleisli function, or when a common response callback is used by many call sites.

  21. abstract def expect[A](req: F[Request[F]])(implicit d: EntityDecoder[F, A]): F[A]
    Annotations
    @deprecated
    Deprecated

    (Since version 0.23.16) Use req.flatMap(expect(_))

  22. abstract def fetch[A](req: F[Request[F]])(f: (Response[F]) => F[A]): F[A]

    Submits a request, and provides a callback to process the response.

    Submits a request, and provides a callback to process the response.

    req

    An effect of the request to submit

    f

    A callback for the response to req. The underlying HTTP connection is released when the returned task completes. Attempts to read the response body afterward will result in an error.

    returns

    The result of applying f to the response to req

    Annotations
    @deprecated
    Deprecated

    (Since version 0.21.5) Use req.flatMap(run(_).use(f))

  23. abstract def fetch[A](req: Request[F])(f: (Response[F]) => F[A]): F[A]

    Submits a request, and provides a callback to process the response.

    Submits a request, and provides a callback to process the response.

    req

    The request to submit

    f

    A callback for the response to req. The underlying HTTP connection is released when the returned task completes. Attempts to read the response body afterward will result in an error.

    returns

    The result of applying f to the response to req

    Annotations
    @deprecated
    Deprecated

    (Since version 0.21.5) Use run(req).use(f)

  24. abstract def fetchAs[A](req: F[Request[F]])(implicit d: EntityDecoder[F, A]): F[A]

    Submits a request and decodes the response, regardless of the status code.

    Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is released at the completion of the decoding.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.23.16) Use req.flatMap(fetchAs(_))

  25. abstract def status(req: F[Request[F]]): F[Status]

    Submits a request and returns the response status

    Submits a request and returns the response status

    Annotations
    @deprecated
    Deprecated

    (Since version 0.23.16) Use req.flatMap(status(_))

  26. abstract def successful(req: F[Request[F]]): F[Boolean]

    Submits a request and returns true if and only if the response status is successful

    Submits a request and returns true if and only if the response status is successful

    Annotations
    @deprecated
    Deprecated

    (Since version 0.23.16) Use req.flatMap(successful(_))

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(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def expectOptionOrT[A](req: Request[F])(onError: (Response[F]) => F[Throwable])(implicit d: EntityDecoder[F, A]): OptionT[F, A]

    As #expectOptionOr, but defined in terms of cats.data.OptionT.

  9. final def expectOptionT[A](req: Request[F])(implicit d: EntityDecoder[F, A]): OptionT[F, A]

    As #expectOption, but defined in terms of cats.data.OptionT.

  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. def translate[G[_]](fk: ~>[F, G])(gK: ~>[G, F])(implicit F: MonadCancelThrow[F]): Client[G]

    Translates the effect type of this client from F to G

  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped