utils_http v0.1.0 UtilsHttp.Behaviour.HttpClient behaviour

Behaviour for making HTTP requests, to be implemented by adapters.

Link to this section Summary

Callbacks

HTTP DELETE request.

HTTP GET request, all payload is URL encoded.

HTTP POST request.

HTTP PUT request.

Link to this section Types

Link to this type

http_header()

Specs

http_header() :: Http.Client.HTTPoison.http_header()

Specs

payload() :: map() | binary()

Specs

response() ::
  {:ok, nil | map() | String.t() | [map()]} | {:error, HttpError.t()}

Link to this section Callbacks

Link to this callback

delete(arg1, list, arg3)

Specs

delete(String.t(), [http_header()], Keyword.t()) :: response()

HTTP DELETE request.

Link to this callback

get(arg1, list, arg3)

Specs

get(String.t(), [http_header()], Keyword.t()) :: response()

HTTP GET request, all payload is URL encoded.

Link to this callback

post(arg1, payload, list, arg4)

Specs

post(String.t(), payload(), [http_header()], Keyword.t()) :: response()

HTTP POST request.

Link to this callback

put(arg1, payload, list, arg4)

Specs

put(String.t(), payload(), [http_header()], Keyword.t()) :: response()

HTTP PUT request.