Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Http Client Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • 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:

    • Web Scraping/Crawling: Concurrent requests with rate limiting (via interceptors).
    • Third-Party Integrations: Reliable, retryable calls to payment gateways, SaaS APIs, or legacy systems.
    • Edge Computing: Lightweight HTTP clients for serverless edge functions (e.g., Cloudflare Workers, Fly.io).
    • Debugging/Observability: Log requests/responses to HAR files for performance analysis (via LogHttpArchive).

When to Consider This Package

  • Adopt if:

    • Your PHP app requires high concurrency (e.g., >100 parallel requests) and blocking I/O is unacceptable.
    • You need HTTP/2 support (multiplexing, header compression) without ext/curl.
    • You’re using Amp, Swoole, or ReactPHP and want native async integration.
    • You prioritize connection reuse (keep-alive, pooling) to reduce latency.
    • You need fine-grained control over requests/responses (interceptors for auth, caching, etc.).
  • Look elsewhere if:

    • You’re not using async PHP (blocking curl may suffice).
    • Your use case is simple (e.g., occasional API calls with no concurrency needs).
    • You require PSR-7 compliance (this library uses mutable Request/Response objects).
    • Your team lacks async PHP experience (steep learning curve for fibers/non-blocking I/O).
    • You need enterprise-grade support (this is a community-driven project; consider Guzzle for battle-tested sync/async hybrid).

How to Pitch It (Stakeholders)

For Executives:

*"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:

  • Faster data pipelines: Process 1,000+ third-party API calls in parallel (vs. sequentially).
  • Lower costs: Reduce server resources by reusing HTTP connections (HTTP/2 multiplexing).
  • Future-proof: Align with PHP’s async ecosystem (Amp/Swoole) to avoid tech debt. It’s MIT-licensed, dependency-light, and integrates with our existing stack—no vendor lock-in."

For Engineers:

*"amphp/http-client gives us a high-performance, async HTTP layer with:

  • No curl dependency: Pure PHP implementation (TCP + HTTP/1.1/2).
  • Batteries included: Built-in redirects, compression, cookies, and interceptors (e.g., retries, caching).
  • Seamless Amp integration: Works with fibers for non-blocking I/O.
  • Extensible: Add custom logic via interceptors (e.g., auth, rate limiting). Tradeoff: Steeper learning curve for async PHP, but worth it for high-scale systems. Start with simple 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).

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata