An answer, shaped like the Fetch API's Response: a status, headers (a list of lowercase names and values, with one entry per Set-Cookie), and the body as a binary.
Summary
Functions
A header's value, or nil.
The body as JSON: {:ok, value} or :error.
An answer of body with a status and headers.
Whether the status is 2xx, as response.ok.
The answer with a header set, replacing any of that name.
The Set-Cookie headers.
The body as text.
Types
@type t() :: %Runlight.Http.Response{ body: binary(), headers: Runlight.Http.Headers.t(), status: non_neg_integer() }
Functions
A header's value, or nil.
The body as JSON: {:ok, value} or :error.
@spec new(binary() | nil, non_neg_integer(), Enumerable.t()) :: t()
An answer of body with a status and headers.
Whether the status is 2xx, as response.ok.
The answer with a header set, replacing any of that name.
The Set-Cookie headers.
The body as text.