hex_http behaviour (hex_core v0.7.1) View Source

HTTP contract.

Link to this section Summary

Link to this section Types

Specs

body() :: {contentType :: binary(), body :: binary()} | :undefined

Specs

headers() :: %{optional(binary()) => binary()}

Specs

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

Specs

status() :: non_neg_integer()

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()}

Link to this section Callbacks

Specs

request(method(), uRI :: binary(), headers(), body(), adapter_config()) ::
  {:ok, status(), headers(), binary()} | {:error, term()}