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

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(client, url, headers, opts)

View Source
@spec get(
  client :: module(),
  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 function

post(client, url, payload, headers, opts)

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