Tinkex.API.Response (Tinkex v0.3.4)
View SourceWrapper around HTTP responses with metadata and parsing helpers.
Summary
Functions
Retrieve a header value (case-insensitive).
Build a response wrapper from a Finch response.
Parse the response body using a module or function.
Types
@type t() :: %Tinkex.API.Response{ body: binary(), data: term() | nil, elapsed_ms: non_neg_integer(), headers: map(), method: atom(), retries: non_neg_integer(), status: integer(), url: String.t() }
Functions
Retrieve a header value (case-insensitive).
@spec new( Finch.Response.t(), keyword() ) :: t()
Build a response wrapper from a Finch response.
Parse the response body using a module or function.
- Module parser: must export
from_json/1 - Function parser: unary function that accepts the decoded JSON
- nil parser: returns the decoded JSON map