View Source Kadabra.Request (Kadabra v0.6.1)
Struct to encapsulate Kadabra requests.
Useful when queueing multiple requests at once through
Kadabra.request/2
Summary
Functions
Returns a new Kadabra.Request
struct from given opts.
Types
@type t() :: %Kadabra.Request{ body: binary(), headers: [], on_response: (Kadabra.Stream.Response.t() -> no_return()) }
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
}