AtEx v0.20.21 AtEx.Gateway.Base View Source

Base HTTP Gateway for AtEx.Gateway.Base

Link to this section Summary

Functions

Macro to import necessary code into HTTP Gateways, This Macro accepts a list as configuration at the moment it's used configure the HTTP Base Url.

Link to this section Functions

Link to this macro

__using__(opts)

View Source (macro)

Macro to import necessary code into HTTP Gateways, This Macro accepts a list as configuration at the moment it's used configure the HTTP Base Url.

Parameters

  • list: list of parameters for HTTP client configuration

Examples

defmodule AtEx.Gateway.Voice do
  use AtEx.Gateway.Base, url: "http://test.com"
  @username "some_username"

  def collect_minutes(attrs) do
    params =
    attrs
    |> Map.put(:username, @username)

    {:ok, resp} = get("/minutes", params)
    process_result(resp.body)
  end
end