LemonCore.Httpc (lemon_core v0.1.0)

View Source

Thin wrapper around Erlang's :httpc.

Goals:

  • Centralize :inets/:ssl startup for call sites that want to use built-in HTTP.
  • Keep call sites consistent while still returning :httpc's native return values.

This wrapper intentionally does not attempt to normalize response formats.

Summary

Functions

Ensure :inets and :ssl are started.

Types

http_opts()

@type http_opts() :: keyword()

method()

@type method() :: :get | :post | :put | :patch | :delete | :head | atom()

opts()

@type opts() :: keyword()

request()

@type request() :: term()

Functions

ensure_started()

@spec ensure_started() :: :ok

Ensure :inets and :ssl are started.

request(method, request, http_opts \\ [], opts \\ [])

@spec request(method(), request(), http_opts(), opts()) :: term()

Call :httpc.request/4 after ensuring OTP apps are started.