hex_http behaviour (hex_core v0.8.4) 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()}.

Link to this section Functions

Link to this function

request(Config, Method, URI, Headers, Body)

View Source

Specs

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