Class

org.http4s.client

Client

Related Doc: package client

Permalink

final case class Client(open: Service[Request, DisposableResponse], shutdown: Task[Unit]) extends Product with Serializable

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

open

a service to asynchronously return a DisposableResponse from a Request. This is a low-level operation intended for client implementations and middlewares.

shutdown

a Task to shut down this Shutdown this client, closing any open connections and freeing resources

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Client
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Client(open: Service[Request, DisposableResponse], shutdown: Task[Unit])

    Permalink

    open

    a service to asynchronously return a DisposableResponse from a Request. This is a low-level operation intended for client implementations and middlewares.

    shutdown

    a Task to shut down this Shutdown this client, closing any open connections and freeing resources

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def expect[A](req: Task[Request])(implicit d: EntityDecoder[A]): Task[A]

    Permalink
  8. def expect[A](s: String)(implicit d: EntityDecoder[A]): Task[A]

    Permalink

    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.

  9. def expect[A](uri: Uri)(implicit d: EntityDecoder[A]): Task[A]

    Permalink

    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.

  10. def expect[A](req: Request)(implicit d: EntityDecoder[A]): Task[A]

    Permalink

    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.

  11. def fetch[A](req: Task[Request])(f: (Response) ⇒ Task[A]): Task[A]

    Permalink

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

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

    req

    A Task 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

  12. def fetch[A](req: Request)(f: (Response) ⇒ Task[A]): Task[A]

    Permalink

    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

  13. def fetchAs[A](req: Request)(implicit d: EntityDecoder[A]): Task[A]

    Permalink

    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.

  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def get[A](s: String)(f: (Response) ⇒ Task[A]): Task[A]

    Permalink

    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.

  16. def get[A](uri: Uri)(f: (Response) ⇒ Task[A]): Task[A]

    Permalink

    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

  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. val open: Service[Request, DisposableResponse]

    Permalink

    a service to asynchronously return a DisposableResponse from a Request.

    a service to asynchronously return a DisposableResponse from a Request. This is a low-level operation intended for client implementations and middlewares.

  23. val shutdown: Task[Unit]

    Permalink

    a Task to shut down this Shutdown this client, closing any open connections and freeing resources

  24. def shutdownNow(): Unit

    Permalink

    Shuts this client down, and blocks until complete.

  25. def streaming[A](req: Request)(f: (Response) ⇒ Process[Task, A]): Process[Task, A]

    Permalink
  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  27. def toHttpService: HttpService

    Permalink

    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. fetch, fetchAs, toService, and streaming are safer alternatives, as their signatures guarantee disposal of the HTTP connection.

  28. def toService[A](f: (Response) ⇒ Task[A]): Service[Request, A]

    Permalink

    Returns this client as a Service.

    Returns this client as a Service. All connections created by this service are disposed on completion of callback task f.

    This method effectively reverses the arguments to fetch, 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.

  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def apply(req: Task[Request]): Task[Response]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12) Use toHttpService =<< req for compatibility, or fetch for safety

  2. def apply(uri: Uri): Task[Response]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12) Use toHttpService.run(Request(Method.GET, uri)).run for compatibility, or get for safety

  3. def apply(req: Request): Task[Response]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12) Use toHttpService.run for compatibility, or fetch for safety

  4. def fetchAs[A](req: Task[Request])(implicit d: EntityDecoder[A]): Task[A]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  5. def getAs[A](s: String)(implicit d: EntityDecoder[A]): Task[A]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  6. def getAs[A](uri: Uri)(implicit d: EntityDecoder[A]): Task[A]

    Permalink

    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.

    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  7. def prepAs[T](req: Task[Request])(implicit d: EntityDecoder[T]): Task[T]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  8. def prepAs[A](uri: Uri)(implicit d: EntityDecoder[A]): Task[A]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12) Use getAs

  9. def prepAs[A](req: Request)(implicit d: EntityDecoder[A]): Task[A]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.14) Use expect

  10. def prepare(req: Task[Request]): Task[Response]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12) Use toHttpService =<< req for compatibility, or fetch for safety

  11. def prepare(uri: Uri): Task[Response]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12) Use toHttpService.run(Request(Method.GET, uri)).run for compatibility, or get for safety

  12. def prepare(req: Request): Task[Response]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.12) Use toHttpService.run for compatibility, or fetch for safety

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped