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.
- Companion:
- object
- Source:
- Client.scala
Value members
Abstract methods
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.
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.
- Source:
- Client.scala
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.
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.
- Source:
- Client.scala
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.
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.
- Source:
- Client.scala
- Source:
- Client.scala
Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is released at the completion of the decoding.
Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is released at the completion of the decoding.
- Source:
- Client.scala
Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is released at the completion of the decoding.
Submits a request and decodes the response, regardless of the status code. The underlying HTTP connection is released at the completion of the decoding.
- Source:
- Client.scala
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 released when the returned task completes. Attempts to read the response body afterward will result in an error.
- uri
The URI to GET
- Returns:
The result of applying f to the response to req
- Source:
- Client.scala
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.
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.
- Source:
- Client.scala
Submits a request and returns the response status
Submits a request and returns the response status
- Source:
- Client.scala
Submits a request and returns the response status
Submits a request and returns the response status
- Source:
- Client.scala
Submits a GET request to the URI and returns the response status
Submits a GET request to the URI and returns the response status
- Source:
- Client.scala
Submits a GET request to the URI and returns the response status
Submits a GET request to the URI and returns the response status
- Source:
- Client.scala
Run the request as a stream. The response lifecycle is equivalent to the returned Stream's.
Run the request as a stream. The response lifecycle is equivalent to the returned Stream's.
- Source:
- Client.scala
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
- Source:
- Client.scala
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
- Source:
- Client.scala
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.
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, [[fetchAsA*]], toKleisli, and stream are safer alternatives, as their signatures guarantee release of the HTTP connection.
- Source:
- Client.scala
Returns this client as a cats.data.Kleisli. All connections created by this service are released on completion of callback task f.
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.
- Source:
- Client.scala
Concrete methods
As expectOptionOr, but defined in terms of cats.data.OptionT.
As expectOptionOr, but defined in terms of cats.data.OptionT.
- Source:
- Client.scala
As expectOption, but defined in terms of cats.data.OptionT.
As expectOption, but defined in terms of cats.data.OptionT.
- Source:
- Client.scala
Translates the effect type of this client from F to G
Translates the effect type of this client from F to G
- Source:
- Client.scala
Deprecated methods
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 released when the returned task completes. Attempts to read the response body afterward will result in an error.
- req
The request to submit
- Returns:
The result of applying f to the response to req
- Deprecated
- Source:
- Client.scala
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 released 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
- Returns:
The result of applying f to the response to req
- Deprecated
- Source:
- Client.scala