amphp/http-client
Asynchronous HTTP client for PHP built on Revolt and fibers. Supports HTTP/1 & HTTP/2, concurrent requests, connection pooling, redirects, gzip/deflate, streaming bodies, TLS by default, forms, cookies, and proxies—no ext/curl dependency.
Asynchronous Microservices & APIs:
Build high-performance, non-blocking HTTP clients for microservices, APIs, or event-driven architectures (e.g., real-time data pipelines, IoT telemetry, or serverless functions). Replace synchronous curl-based requests with concurrent, scalable alternatives.
Roadmap: Shift from Synchronous to Async PHP: Align with PHP’s growing async ecosystem (e.g., Swoole, RoadRunner, or Amp) to modernize legacy monoliths or greenfield projects. This package enables HTTP/2 support, connection pooling, and streaming responses—critical for high-throughput systems.
Build vs. Buy:
Buy for core HTTP needs (avoid reinventing TCP/HTTP parsing). Build on top for domain-specific logic (e.g., custom interceptors for auth, caching, or retries). Example: Extend with amphp/http-client-cache for private caching without external dependencies.
Use Cases:
LogHttpArchive).Adopt if:
ext/curl.Look elsewhere if:
curl may suffice).Request/Response objects).*"This package lets us replace slow, blocking HTTP calls with asynchronous, concurrent requests—cutting latency and scaling our API integrations to handle 10x more traffic. For example:
*"amphp/http-client gives us a high-performance, async HTTP layer with:
curl dependency: Pure PHP implementation (TCP + HTTP/1.1/2).GET requests, then layer on concurrency/streaming as needed."*Key Metric to Track: "Reduce API response times by 80% for concurrent workloads" (via benchmarking against curl/Guzzle).
How can I help you explore Laravel packages today?