hex_http behaviour (hex_core v0.8.3) View Source

HTTP contract.

Link to this section Summary

Link to this section Types

Specs

body() :: {ContentType :: binary(), Body :: binary()} | undefined.

Specs

headers() :: #{binary() => binary()}.

Specs

method() :: get | post | put | patch | delete.

Specs

status() :: non_neg_integer().

Link to this section Callbacks

Specs

request(method(), URI :: binary(), headers(), body(), adapter_config()) ->
           {ok, status(), headers(), binary()} | {error, term()}.