feat(httpclient): publish the initial httpclient package #2
merged
@chrismichaelps wrote on 2026-10-06
Closes #1
Behaviour
@chrismichaelps/pudu-lang-httpclient 0.1.0 for Pudu 0.1.3: named, configured HTTP clients made by a factory that owns their handler pipelines and connections.
- Messages — requests with verbs, headers, version policies, typed options, and receivers for streamed responses; bodies of text, bytes, forms, multipart parts, JSON documents, derived values, or a producer streamed in chunks; responses with
ensureSuccess, readers, trailers, andretryAfter. - Client — base address, default headers, timeout, response buffer limit, default version,
cancelPending; verb helpers, text, bytes, streams, JSON helpers, and declarativeEndpointtemplates.Client.pooledbuilds one long-lived client to configure once and share. - Factory — named clients with defaults applied to every client, typed clients,
createHandler,rotatingHandler, handler lifetimes with rotation and closing of retired pipelines after a grace period, validation reporting every problem at once. - Handlers — delegating handlers composed outermost first, handler factories, rearrangement, observers placed outside and inside every handler, header redaction.
- Transport — pooled keep-alive connections per route, connection lifetime and idle timeout, a per-server limit, connect timeout, redirects (credentials dropped across origins, never https to http), gzip, cookie jars that save and restore, proxies with
CONNECTtunnels, an address policy, head and body limits, and stale-connection retry. - Integrations — logging (
pudu-lang-log), resilience with a standard and a hedging pipeline, per-request selection, registries, and transient predicates (pudu-lang-resilience), header propagation, authorization with token refresh, and metrics. - Events — plain listeners for requests and pipelines, carried by a
pudu-lang-mediatormediator the package owns; no public signature names a mediator type. - Testing — a stub primary handler answering from rules and recording requests.
Verification
Against the published 0.1.3 compiler, from a clean pudu install --locked:
pudu check,pudu fmt --check, andpudu lintare clean oversrc test tools examples.pudu test test: 41 suites pass, 434 assertions, including loopback servers for keep-alive, chunked and close-framed bodies, interim responses, redirects, proxies, cookies, gzip, deadlines, pool limits and lifetimes, streamed uploads, factory rotation, the vault parity suite, and an integration scenario.- Every program under
examples/answers 0. - Mutation testing of
Domain/against the domain suites kills every valid mutant. - A compiler issue found along the way is reported upstream: chrismichaelps/pudu-lang#442.
