PHPackages                             fast-forward/http-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. fast-forward/http-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

fast-forward/http-client
========================

Fast Forward PSR-18 HTTP Client Factory

v1.1.0(3mo ago)03431MITPHPPHP ^8.3CI passing

Since Jun 12Pushed 2mo agoCompare

[ Source](https://github.com/php-fast-forward/http-client)[ Packagist](https://packagist.org/packages/fast-forward/http-client)[ Docs](https://github.com/php-fast-forward)[ RSS](/packages/fast-forward-http-client/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (11)Versions (4)Used By (1)

FastForward HTTP Client
=======================

[](#fastforward-http-client)

[![PHP Version](https://camo.githubusercontent.com/c9b19f1cbf8aefb8c278c8b5d392b64401164a08fced6ccbf376b32135d6714f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e332d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/releases/)[![Composer Package](https://camo.githubusercontent.com/1e8cf44d596d2f4d69404b217be7dbe7a0e37be05765fd25e05d8a7667ac7afd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d666173742d2d666f7277617264253246687474702d2d636c69656e742d4632384431412e7376673f6c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465)](https://packagist.org/packages/fast-forward/http-client)[![Tests](https://camo.githubusercontent.com/1bb4aa6c9269b71c88852a62e361660e76aab7e98c296ec5d985d1d9fa15e857/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d666173742d666f72776172642f687474702d636c69656e742f74657374732e796d6c3f6c6f676f3d676974687562616374696f6e73266c6f676f436f6c6f723d7768697465266c6162656c3d746573747326636f6c6f723d323243353545)](https://github.com/php-fast-forward/http-client/actions/workflows/tests.yml)[![Coverage](https://camo.githubusercontent.com/783041b70aa9cfca2a0969ddc49e11178a3367b14165ef787853fdc3075f43b3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d706870756e69742d3441444538303f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://php-fast-forward.github.io/http-client/coverage/index.html)[![Docs](https://camo.githubusercontent.com/9efb0d9808fa3e59c9e7b69c4e3ba671210a6a41cefab648326c0239ccefde0a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6465706c6f796d656e74732f7068702d666173742d666f72776172642f687474702d636c69656e742f6769746875622d70616765733f6c6f676f3d72656164746865646f6373266c6f676f436f6c6f723d7768697465266c6162656c3d646f6373266c6162656c436f6c6f723d31453239334226636f6c6f723d333842444638267374796c653d666c6174)](https://php-fast-forward.github.io/http-client/index.html)[![License](https://camo.githubusercontent.com/f9af668efac9539ba31cfaf7d4fdd29e1c3447514ebfbccbd924ac01d2aabf16/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7068702d666173742d666f72776172642f687474702d636c69656e743f636f6c6f723d363437343842)](LICENSE)[![GitHub Sponsors](https://camo.githubusercontent.com/d61f432861a7c60e0a9620738dffd3b884bcf392c86e48a2cc87ea57a077e90a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73706f6e736f72732f7068702d666173742d666f72776172643f6c6f676f3d67697468756273706f6e736f7273266c6f676f436f6c6f723d776869746526636f6c6f723d454334383939)](https://github.com/sponsors/php-fast-forward)

[![PSR-11](https://camo.githubusercontent.com/1476c9bd279218794173c3d24e2c9ec06bedb3bfcff397debe19894ea360a303/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d2d31312d636f6e7461696e65722d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php-fig.org/psr/psr-11/)[![PSR-18](https://camo.githubusercontent.com/5608957bffaeaaa11a178a3aaa7e8d63f9c633d7ada17514809d2d77b0bed371/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5053522d2d31382d687474702d2d636c69656e742d3737374242343f6c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php-fig.org/psr/psr-18/)

FastForward HTTP Client is a focused integration package that registers a PSR-18 HTTP client in a FastForward-compatible container. It uses Symfony HttpClient as the transport layer and exposes `Psr\Http\Client\ClientInterface` for application code.

What this package does
----------------------

[](#what-this-package-does)

- Registers `Psr\Http\Client\ClientInterface` as `Symfony\Component\HttpClient\Psr18Client`
- Registers `Symfony\Component\HttpClient\HttpClient` through `HttpClient::create()`
- Fits naturally into `fast-forward/container` service-provider based configuration

Important note for first-time users
-----------------------------------

[](#important-note-for-first-time-users)

This package does not register PSR-17 factories on its own. To resolve `Psr\Http\Client\ClientInterface`, your container must already provide:

- `Psr\Http\Message\ResponseFactoryInterface`
- `Psr\Http\Message\StreamFactoryInterface`

In a FastForward application, the usual solution is to install [`fast-forward/http-factory`](https://github.com/php-fast-forward/http-factory)or the all-in-one [`fast-forward/http`](https://github.com/php-fast-forward/http) metapackage.

Installation
------------

[](#installation)

Install the package itself:

```
composer require fast-forward/http-client
```

Choose one of these setups:

- If your container already provides PSR-17 factories, `fast-forward/http-client`is enough.
- If you want explicit FastForward PSR-17 and PSR-18 providers, install `fast-forward/http-client fast-forward/http-factory`.
- If you want the shortest onboarding path, install `fast-forward/http`.

Quick start
-----------

[](#quick-start)

This example uses both `fast-forward/http-factory` and `fast-forward/http-client` so it works in a fresh project:

```
