Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

php-fast-forward/http-client

Repository files navigation

πŸš€ FastForward HTTP Client

PHP Version License CI

A PSR-11 compatible service provider that registers a fully functional set of PSR-18 HTTP client using Symfony HttpClient and Psr18Client.

Designed to work out of the box with the php-fast-forward/container autowiring system.


πŸ“¦ Installation

composer require fast-forward/http-client

βœ… Features

  • Registers the default Symfony HttpClient using `HttpClient::create()
  • Registers the PSR-18 Psr18Client with its dependencies injected
  • Provides aliases for:
    • Psr\Http\Client\ClientInterface
    • Symfony\Component\HttpClient\HttpClient

πŸ› οΈ Usage

If you’re using fast-forward/container:

use FastForward\Container\container;
use FastForward\Config\ArrayConfig;
use FastForward\Container\ContainerInterface;
$config = new ArrayConfig([
 ContainerInterface::class => [
 // Reference the service provider by class name
 FastForward\Http\Client\ServiceProvider\HttpClientServiceProvider::class,
 ],
]);
$container = container($config);
$client = $container->get(Psr\Http\Client\ClientInterface::class);
$response = $client->sendRequest($yourPsr7Request);

πŸ”§ Services Registered

The following services will be automatically registered in your container when using HttpClientServiceProvider:

Service Interface Implementation Source
Symfony\Component\HttpClient\HttpClient Registered via MethodFactory::create()
Psr\Http\Client\ClientInterface Symfony\Component\HttpClient\Psr18Client

πŸ“‚ License

This package is open-source software licensed under the MIT License.


🀝 Contributing

Contributions, issues, and feature requests are welcome!
Feel free to open a GitHub Issue or submit a Pull Request.

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /