Polyjuice Client v0.1.0 Polyjuice.Client.Endpoint.HttpSpec View Source

Link to this section Summary

Types

t()

The description of how to handle the endpoint.

Link to this section Types

Link to this type

t()

View Source
t() :: %Polyjuice.Client.Endpoint.HttpSpec{
  auth_required: true | false,
  body: String.t(),
  headers: [{String.t(), String.t()}],
  method: atom(),
  transform: (integer(), [{String.t(), String.t()}, ...], String.t() -> any()),
  url: String.t()
}

The description of how to handle the endpoint.

  • method is the HTTP verb
  • headers is a list of the HTTP headers
  • url is the URL to call
  • body is the HTTP body (if any)
  • transform is a function to transform the result (status code, headers, content) to a return value
  • auth_required indicates whether the end point requires authentication