Kadabra.Request (Kadabra v0.6.0) View Source

Struct to encapsulate Kadabra requests.

Useful when queueing multiple requests at once through Kadabra.request/2

Link to this section Summary

Functions

Returns a new Kadabra.Request struct from given opts.

Link to this section Types

Specs

t() :: %Kadabra.Request{
  body: binary(),
  headers: [],
  on_response: (Kadabra.Stream.Response.t() -> no_return())
}

Link to this section Functions

Returns a new Kadabra.Request struct from given opts.

Examples

iex> Kadabra.Request.new([
...>   headers: [{":method", "GET"}, {"path", "/"}],
...>   body: "",
...>   on_response: &IO.inspect/1
...> ])
%Kadabra.Request{
  headers: [{":method", "GET"}, {"path", "/"}],
  body: "",
  on_response: &IO.inspect/1
}