exhal v8.2.0 ExHal.Client behaviour

Behavior related to making HTTP requests.

Examples

iex> ExHal.Client.new()
%ExHal.Client{}

Link to this section Summary

Types

The return value of any function that makes an HTTP request.

t()

Represents a client configuration/connection. Create with new function.

Link to this section Types

Link to this type

http_response()
http_response() ::
  {:ok, ExHal.Document.t() | ExHal.NonHalResponse.t(), ExHal.ResponseHeader.t()}
  | {:error, ExHal.Document.t() | ExHal.NonHalResponse.t(),
     ExHal.ResponseHeader.t()}
  | {:error, Error.t()}

The return value of any function that makes an HTTP request.

Link to this opaque

t() (opaque)
t()

Represents a client configuration/connection. Create with new function.

Link to this section Functions

Link to this function

add_headers(client, headers)
add_headers(ExHal.Client.t(), Keyword.t()) :: ExHal.Client.t()

Returns client that will include the specified headers in any request made with it.

Link to this function

delete(client, url, opts \\ [])

Link to this function

get(client, url, opts \\ [])

Link to this function

new(headers, list)

Returns a new client.

Link to this function

patch(client, url, body, opts \\ [])

Link to this function

post(client, url, body, opts \\ [])

Link to this function

put(client, url, body, opts \\ [])

Link to this section Callbacks

Link to this callback

delete(arg1, arg2, arg3)

Link to this callback

patch(arg1, arg2, <<>>, arg4)
patch(ExHal.Client.t(), String.t(), <<_::0>>, Keyword.t()) :: http_response()

Link to this callback

post(arg1, arg2, <<>>, arg4)
post(ExHal.Client.t(), String.t(), <<_::0>>, Keyword.t()) :: http_response()

Link to this callback

put(arg1, arg2, <<>>, arg4)
put(ExHal.Client.t(), String.t(), <<_::0>>, Keyword.t()) :: http_response()