View Source hex_http behaviour (hex_core v0.10.0)

HTTP contract.

Link to this section Summary

Link to this section Types

-type body() :: {ContentType :: binary(), Body :: binary()} | undefined.
-type headers() :: #{binary() => binary()}.
-type method() :: get | post | put | patch | delete.
-type status() :: non_neg_integer().

Link to this section Callbacks

-callback 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
-spec request(hex_core:config(), method(), URI :: binary(), headers(), body()) ->
           {ok, {status(), headers(), binary()}} | {error, term()}.