EmberClient

org.http4s.ember.client.EmberClient
final class EmberClient[F[_]]

Attributes

Source
EmberClient.scala
Graph
Supertypes
trait Client[F]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def defaultOnError(req: Request[F])(resp: Response[F])(implicit G: Applicative[F]): F[Throwable]

Attributes

Definition Classes
Source
EmberClient.scala
def run(req: Request[F]): Resource[F, Response[F]]

Attributes

Source
EmberClient.scala
def state: F[(Int, Map[RequestKey, Int])]

The reason for this extra class.

The reason for this extra class. This allows you to see the present state of the underlying Pool, without having access to the pool itself.

The first element represents total connections in the pool, the second is a mapping between the number of connections in the pool for each requestKey.

Attributes

Source
EmberClient.scala

Inherited methods

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 closed at the completion of the decoding.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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 closed at the completion of the decoding.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def expect[A](req: F[Request[F]])(implicit d: EntityDecoder[F, A]): F[A]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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 closed at the completion of the decoding.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def expectOption[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[Option[A]]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def expectOptionOr[A](req: Request[F])(onError: Response[F] => F[Throwable])(implicit d: EntityDecoder[F, A]): F[Option[A]]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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.

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

Attributes

Inherited from:
Client
Source
Client.scala
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.

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

Attributes

Inherited from:
Client
Source
Client.scala
def expectOr[A](s: String)(onError: Response[F] => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def expectOr[A](uri: Uri)(onError: Response[F] => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def expectOr[A](req: F[Request[F]])(onError: Response[F] => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def expectOr[A](req: Request[F])(onError: Response[F] => F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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.

Value parameters

f

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

req

An effect of the request to submit

Attributes

Returns

The result of applying f to the response to req

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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.

Value parameters

f

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

req

The request to submit

Attributes

Returns

The result of applying f to the response to req

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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 closed at the completion of the decoding.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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 closed at the completion of the decoding.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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 closed at the completion of the decoding.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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.

Value parameters

f

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

uri

The URI to GET

Attributes

Returns

The result of applying f to the response to req

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def status(req: F[Request[F]]): F[Status]

Submits a request and returns the response status

Submits a request and returns the response status

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def status(req: Request[F]): F[Status]

Submits a request and returns the response status

Submits a request and returns the response status

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
override def statusFromString(s: String): F[Status]

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

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

Attributes

Definition Classes
Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
override def statusFromUri(uri: Uri): F[Status]

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

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

Attributes

Definition Classes
Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def streaming[A](req: F[Request[F]])(f: Response[F] => Stream[F, A]): Stream[F, A]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def streaming[A](req: Request[F])(f: Response[F] => Stream[F, A]): Stream[F, A]

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def successful(req: 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

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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 dispose of the underlying HTTP connection.

This is intended for use in proxy servers. run, fetchAs, toKleisli and stream signatures guarantee disposal of the HTTP connection.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
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 disposed 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.

Attributes

Inherited from:
DefaultClient (hidden)
Source
DefaultClient.scala
def translate[G[_]](fk: FunctionK[F, G])(gK: FunctionK[G, F])(implicit F: MonadCancelThrow[F]): Client[G]

Translates the effect type of this client from F to G

Translates the effect type of this client from F to G

Attributes

Inherited from:
Client
Source
Client.scala