waaseyaa/http-client

Minimal HTTP client for JSON APIs and webhooks

Maintainers

Package info

github.com/waaseyaa/http-client

pkg:composer/waaseyaa/http-client

Statistics

Installs: 2 664

Dependents: 5

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0-alpha.249 2026-06-23 02:41 UTC

This package is auto-updated.

Last update: 2026-06-25 00:57:09 UTC


README

Layer 0 — Foundation

Minimal HTTP client for JSON APIs and webhooks.

HttpClientInterface exposes a generic request(string $method, string $url, …) plus get() / post() convenience helpers — other verbs (PUT/DELETE/PATCH/…) go through request(); there are no dedicated put()/delete()/patch() methods. StreamHttpClient is the production implementation backed by PHP streams. Returns HttpResponse value objects (no shared state) and throws HttpRequestException on transport failures. Designed as an injectable seam — tests replace HttpClientInterface with a fake rather than mocking PHP's stream layer.

Key classes: HttpClientInterface, StreamHttpClient, HttpResponse, HttpRequestException.