View Source CozyAliyunOpenAPI.HTTPClient behaviour (cozy_aliyun_open_api v0.1.2)

The specification for a HTTP client.

It can be set to a client provided by CozyAliyunOpenAPI, such as:

config :cozy_aliyun_open_api,
  http_client: CozyAliyunOpenAPI.HTTPClient.Finch

Or, set it to your own API client, such as:

config :cozy_aliyun_open_api,
  http_client: MyHTTPClient

Link to this section Summary

Types

The response of a request.

Callbacks

Callback to initialize the given API client.

Callback to send a request.

Functions

Issues an HTTP request by the given HTTP client.

Link to this section Types

@type body() :: map() | binary()
@type headers() :: [{binary(), binary()}]
@type response() :: {:ok, status(), headers(), body()} | {:error, term()}

The response of a request.

@type status() :: pos_integer()

Link to this section Callbacks

@callback init() :: :ok

Callback to initialize the given API client.

@callback request(CozyAliyunOpenAPI.HTTPRequest.t()) :: response()

Callback to send a request.

Link to this section Functions

Issues an HTTP request by the given HTTP client.