View Source hex_http behaviour (hex_core v0.10.3)

HTTP contract.

Summary

Types

body/0

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

headers/0

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

method/0

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

status/0

-type status() :: non_neg_integer().

Callbacks

request/5

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

Functions

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

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