View Source Mixpanel.HTTP behaviour (Mixpanel API v1.1.1)

Adapter specification for HTTP clients and API for accessing them.

Summary

Callbacks

@callback get(url :: String.t(), headers :: [{String.t(), binary()}], opts :: keyword()) ::
  {:ok, status :: 200..599, headers :: [{String.t(), binary()}], body :: term()}
  | {:error, String.t()}
Link to this callback

post(url, body, headers, opts)

View Source
@callback post(
  url :: String.t(),
  body :: binary(),
  headers :: [{String.t(), binary()}],
  opts :: keyword()
) ::
  {:ok, status :: 200..599, headers :: [{String.t(), binary()}], body :: term()}
  | {:error, String.t()}

Functions

Link to this function

get(url, headers \\ [], opts \\ [])

View Source
@spec get(url :: String.t(), headers :: [{String.t(), binary()}], opts :: keyword()) ::
  {:ok, status :: 200..599, headers :: [{String.t(), binary()}], body :: term()}
  | :ignore
@spec impl() :: module()
Link to this function

post(url, payload, headers \\ [], opts \\ [])

View Source
@spec post(
  url :: String.t(),
  payload :: binary(),
  headers :: [{String.t(), binary()}],
  opts :: keyword()
) ::
  {:ok, status :: 200..599, headers :: [{String.t(), binary()}], body :: term()}
  | :ignore