Installation

Install the package with Composer:

composer require fast-forward/http-client

That command installs the service provider itself. Whether it is enough for your project depends on what your container already knows how to build.

Requirements

Dependency Constraint Why it matters
PHP ^8.3 The package is written for PHP 8.3 and newer.
fast-forward/container ^1.4 Provides the container and service-provider integration used throughout the examples in this documentation.
psr/http-client ^1.0 Supplies the PSR-18 client contract exposed by the package.
psr/http-factory ^1.1 Supplies the PSR-17 factory interfaces consumed by Psr18Client .
symfony/http-client ^7.3 Provides the transport implementation and the Psr18Client adapter.

What This Package Registers

HttpClientServiceProvider publishes two service IDs:

  • Symfony\Component\HttpClient\HttpClient via HttpClient::create() ;
  • Psr\Http\Client\ClientInterface via Symfony\Component\HttpClient\Psr18Client .

The second one depends on these container services already existing:

  • Psr\Http\Message\ResponseFactoryInterface
  • Psr\Http\Message\StreamFactoryInterface

If those services are missing, resolving ClientInterface will fail even though the package itself is installed correctly.

Next Step

Continue with Quickstart for a complete working example that wires both the HTTP factory provider and the HTTP client provider together.