Shared HTTP utilities for Arcanum adapters.
Centralizes the configurable HTTP client, URL construction, and async response body draining.
Summary
Functions
Builds a full URL from a provider's base_url and a path.
Builds a full URL from a provider's base_url and a path,
also stripping a trailing /v1 segment. Used by Anthropic
which appends its own /v1/messages path.
Drains a Req.Response.Async body into a decoded map or raw binary.
Functions
Builds a full URL from a provider's base_url and a path.
Trims trailing / from the base URL before appending.
Builds a full URL from a provider's base_url and a path,
also stripping a trailing /v1 segment. Used by Anthropic
which appends its own /v1/messages path.
@spec client() :: module()
Returns the configured HTTP client module (defaults to Req).
Drains a Req.Response.Async body into a decoded map or raw binary.
Enforces a 10 MB byte limit to prevent
unbounded memory consumption. Returns nil on any error.
Passes non-async bodies through unchanged.