oaspec/httpc
BEAM HTTP adapter for oaspec generated clients.
oaspec/httpc bridges the pure oaspec/transport.Send contract
to gleam_httpc. The simplest usage is the bare send function:
import oaspec/httpc
import api/client
let result = client.list_pets(httpc.send, ...)
For per-request configuration (timeouts, etc.) use the builder:
let send =
httpc.config()
|> httpc.with_timeout(5_000)
|> httpc.build
Types
Values
pub fn build(
cfg: Config,
) -> fn(transport.Request) -> Result(
transport.Response,
transport.TransportError,
)
Materialise a Send value from a Config. Use this when you’ve
configured timeouts or other options. For the simplest case, prefer
the bare send function, which has the same signature as Send.
pub fn send(
req: transport.Request,
) -> Result(transport.Response, transport.TransportError)
Convenience: equivalent to config() |> build. Provides the most
common no-config path as a single function reference.