webclient / ext-redirect
Redirect extension for PSR-18 HTTP client
Fund package maintenance!
www.paypal.me/ddrv
Installs: 2 526
Dependents: 2
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: ^7.4 || ^8.0
- psr/http-client: ^1.0
Requires (Dev)
- nyholm/psr7: ^1.5
- phpunit/phpunit: ^6.5 || ^7.5 || ^8.5 || ^9.5
- squizlabs/php_codesniffer: ^3.7
- webclient/fake-http-client: ^2.0
Suggests
- psr/http-client-implementation: Choice your favorite psr-18 implementation
Provides
This package is auto-updated.
Last update: 2024-11-21 21:29:52 UTC
README
webclient/ext-redirect
Redirect extension for PSR-18 HTTP client.
Install
Install this package and your favorite psr-18 implementation.
composer require webclient/ext-redirect:^2.0
Using
<?php use Webclient\Extension\Redirect\RedirectClientDecorator; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; /** * @var ClientInterface $client Your PSR-18 HTTP Client * @var int $maxRedirects Max follow redirects */ $http = new RedirectClientDecorator($client, $maxRedirects); /** @var RequestInterface $request */ $response = $http->sendRequest($request);