Http.Client behaviour (fnord v0.9.37)
View SourceThe single seam between fnord and the HTTP transport (HTTPoison/hackney).
Everything that talks to the network - Http's retrying JSON helpers and
the MCP OAuth/discovery modules that need raw control over timeouts and
status handling - goes through impl/0 rather than calling HTTPoison
directly. That keeps the transport injectable per process tree: tests
override :http_client with a Mox mock (see Fnord.TestCase), making the
network structurally unreachable from the suite, while production resolves
to this module's passthrough implementation.
The callback shapes mirror HTTPoison's so call sites keep matching on
%HTTPoison.Response{} / %HTTPoison.Error{}; this module deliberately
adds no behavior of its own.
Summary
Types
@type body() :: iodata()
@type opts() :: keyword()
@type result() :: {:ok, HTTPoison.Response.t() | HTTPoison.AsyncResponse.t() | HTTPoison.MaybeRedirect.t()} | {:error, HTTPoison.Error.t()}
@type url() :: String.t()
Callbacks
Functions
@spec impl() :: module()
Returns the current HTTP transport module. Overridden per process tree via
the :http_client config key for unit testing. See Fnord.TestCase.