HTTP adapter contract for outbound delivery.
request/5 returns {:ok, %{status: status, headers: headers, body: body}}
or {:error, reason}. Issue one request and return redirects to the delivery
runtime for classification. The default adapter is AshHooks.Http.Bounded;
AshHooks.Http.Httpc provides an alternative built on OTP's HTTP client.
Writing an adapter
- Return response headers as a list of
{name, value}tuples with binary names and values. Normalize names to lowercase; conventionalRetry-AfterandContent-Typenames are also recognized. This shape preservesRetry-Afterand content-type handling; a map causes the runtime to use ordinary backoff and theothercontent kind. - Resolve-and-pin: resolve through
AshHooks.Ssrf.resolve_public/1and connect to an address from that validated result. Preserve the original hostname for TLS certificate verification and SNI, and the original authority for the Host header. Resolving again during connection allows DNS rebinding between validation and use. Both supplied adapters pin their connection address. - Bound the complete operation and response memory. Bounded defaults to
15 seconds for the operation, 32 KiB for headers, and 64 KiB for the body.
See
AshHooks.Http.Httpcfor its response-buffering limitations.