larexsetch / http-client-binder
Http client binder is easy way to create http client
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
pkg:composer/larexsetch/http-client-binder
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.10
- jms/serializer: ^3.32
Requires (Dev)
- phpunit/phpunit: ^12.5
This package is auto-updated.
Last update: 2026-01-30 11:04:51 UTC
README
This library creates simple way bind the interface and http call to foreign endpoint
Installation
composer require larexsetch/http-client-binder
Create client interface
You can see example here: HttpClientBinder\Tests\Base\Client\ClientInterface
Build the client
<?php /** @var YourClientInterface $client */ $client = \HttpClientBinder\Fabrics\BinderBuilder::builder(YourClientInterface::class, $baseUrl) // $baseUrl may be declare by annotation @Client(baseUrl="http://example.com") ->temporaryDirectory("/path/to/temporary/directory") // Default /tmp ->encoder($encoder) // Custom encoder ->decoder($decoder) // Custom decoder ->getClient();