View Source Chaperon.Action.HTTP (chaperon v0.3.1)

HTTP based actions to be run in a Chaperon.Scenario module for a given Chaperon.Session.

This supports GET, POST, PUT, PATCH, DELETE & HEAD requests with support for optional headers & query params.

Link to this section Summary

Link to this section Types

@type method() :: :get | :post | :put | :patch | :delete | :head
@type options() :: [
  form: map() | Keyword.t(),
  json: map() | Keyword.t(),
  headers: map() | Keyword.t(),
  params: map() | Keyword.t(),
  decode: :json | (HTTPoison.Response.t() -> any()),
  with_result: Chaperon.Session.result_callback(),
  metrics_url: String.t()
]
@type t() :: %Chaperon.Action.HTTP{
  body: binary(),
  callback: Chaperon.Session.result_callback(),
  decode: :json | (HTTPoison.Response.t() -> any()),
  headers: map(),
  method: method(),
  metrics_url: String.t(),
  params: map(),
  path: String.t()
}

Link to this section Functions

Link to this function

add_options(action, opts)

View Source
@spec add_options(any(), options()) :: t()
Link to this function

delete(path, opts \\ [])

View Source
@spec delete(String.t(), options()) :: t()
Link to this function

full_url(action, session)

View Source
@spec get(String.t(), options()) :: t()
Link to this function

metrics_url(action, session)

View Source
Link to this function

options(action, session)

View Source
@spec patch(String.t(), options()) :: t()
@spec post(String.t(), options()) :: t()
@spec put(String.t(), options()) :: t()
Link to this function

query_params_string(params)

View Source