waaseyaa / http-client
Minimal HTTP client for JSON APIs and webhooks
v0.1.0-alpha.218
2026-05-21 01:17 UTC
Requires
- php: >=8.5
Requires (Dev)
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-06-16 02:03:16 UTC
README
Layer 0 — Foundation
Minimal HTTP client for JSON APIs and webhooks.
HttpClientInterface defines the GET/POST/PUT/DELETE/PATCH surface; 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.