Assent v0.1.6 Assent.HTTPAdapter behaviour View Source

HTTP adapter helper module

Usage

defmodule MyApp.MyHTTPAdapter do
  @behaviour Assent.HTTPAdapter

  @impl true
  def request(method, url, body, haders, opts) do
    # ...
  end
end

Link to this section Summary

Functions

Sets a user agent header

Link to this section Types

Link to this type

headers()

View Source
headers() :: [{binary(), binary()}]
Link to this type

method()

View Source
method() :: :get | :post

Link to this section Functions

Link to this function

user_agent_header()

View Source
user_agent_header() :: {binary(), binary()}

Sets a user agent header

The header value will be Assent-VERSION with VERSION being the :vsn of Assent.

Link to this section Callbacks

Link to this callback

request(method, binary, body, headers, arg5)

View Source
request(method(), binary(), body(), headers(), Keyword.t()) ::
  {:ok, map()} | {:error, any()}