Packages

c

org.http4s.ember.client

EmberClient

final class EmberClient[F[_]] extends DefaultClient[F]

Source
EmberClient.scala
Linear Supertypes
DefaultClient[F], Client[F], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EmberClient
  2. DefaultClient
  3. Client
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    DefaultClient → Client
  2. 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.

    Definition Classes
    DefaultClient → Client
  3. def expect[A](req: F[Request[F]])(implicit d: EntityDecoder[F, A]): F[A]
    Definition Classes
    DefaultClient → Client
  4. 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.

    Definition Classes
    DefaultClient → Client
  5. def expectOption[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[Option[A]]
    Definition Classes
    DefaultClient → Client
  6. def expectOptionOr[A](req: Request[F])(onError: (Response[F]) ⇒ F[Throwable])(implicit d: EntityDecoder[F, A]): F[Option[A]]
    Definition Classes
    DefaultClient → Client
  7. def expectOr[A](s: String)(onError: (Response[F]) ⇒ F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
    Definition Classes
    DefaultClient → Client
  8. def expectOr[A](uri: Uri)(onError: (Response[F]) ⇒ F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
    Definition Classes
    DefaultClient → Client
  9. def expectOr[A](req: F[Request[F]])(onError: (Response[F]) ⇒ F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
    Definition Classes
    DefaultClient → Client
  10. def expectOr[A](req: Request[F])(onError: (Response[F]) ⇒ F[Throwable])(implicit d: EntityDecoder[F, A]): F[A]
    Definition Classes
    DefaultClient → Client
  11. 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 disposed 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

    Definition Classes
    DefaultClient → Client
  12. 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 disposed 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

    Definition Classes
    DefaultClient → Client
  13. 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.

    Definition Classes
    DefaultClient → Client
  14. 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.

    Definition Classes
    DefaultClient → Client
  15. 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.

    Definition Classes
    DefaultClient → Client
  16. 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 disposed 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

    Definition Classes
    DefaultClient → Client
  17. def run(req: Request[F]): Resource[F, Response[F]]
    Definition Classes
    EmberClient → DefaultClient → Client
  18. 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.

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

    Submits a request and returns the response status

    Submits a request and returns the response status

    Definition Classes
    DefaultClient → Client
  20. def status(req: Request[F]): F[Status]

    Submits a request and returns the response status

    Submits a request and returns the response status

    Definition Classes
    DefaultClient → Client
  21. 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

    Definition Classes
    DefaultClient → Client
  22. 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

    Definition Classes
    DefaultClient → Client
  23. 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.

    Definition Classes
    DefaultClient → Client
  24. def streaming[A](req: F[Request[F]])(f: (Response[F]) ⇒ Stream[F, A]): Stream[F, A]
    Definition Classes
    DefaultClient → Client
  25. def streaming[A](req: Request[F])(f: (Response[F]) ⇒ Stream[F, A]): Stream[F, A]
    Definition Classes
    DefaultClient → Client
  26. 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

    Definition Classes
    DefaultClient → Client
  27. 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

    Definition Classes
    DefaultClient → Client
  28. 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 streaming signatures guarantee disposal of the HTTP connection.

    Definition Classes
    DefaultClient → Client
  29. 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.

    Definition Classes
    DefaultClient → Client
  30. def translate[G[_]](fk: ~>[F, G])(gK: ~>[G, F])(implicit arg0: Sync[G], b: BracketThrow[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

    Definition Classes
    Client

Deprecated Value Members

  1. def getAs[A](s: String)(implicit d: EntityDecoder[F, A]): F[A]
    Definition Classes
    DefaultClient → Client
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

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

    Submits a GET request and decodes the response.

    Submits a GET request and decodes the response. The underlying HTTP connection is closed at the completion of the decoding.

    Definition Classes
    DefaultClient → Client
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  3. def prepAs[T](req: F[Request[F]])(implicit d: EntityDecoder[F, T]): F[T]
    Definition Classes
    DefaultClient → Client
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  4. def prepAs[A](req: Request[F])(implicit d: EntityDecoder[F, A]): F[A]
    Definition Classes
    DefaultClient → Client
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  5. def toHttpService: HttpService[F]

    Returns this client as an HttpService.

    Returns this client as an HttpService. 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, streaming are safer alternatives, as their signatures guarantee disposal of the HTTP connection.

    Definition Classes
    DefaultClient → Client
    Annotations
    @deprecated
    Deprecated

    (Since version 0.19) Use toHttpApp. Call .mapF(OptionT.liftF) if OptionT is really desired.

  6. def toService[A](f: (Response[F]) ⇒ F[A]): Service[F, Request[F], A]
    Definition Classes
    DefaultClient → Client
    Annotations
    @deprecated
    Deprecated

    (Since version 0.18) Use toKleisli