webclient / ext-cookie
Cookies extension for PSR-18 HTTP client
Fund package maintenance!
www.paypal.me/ddrv
v2.0.1
2022-11-12 17:34 UTC
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- ext-mbstring: *
- 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
- vimeo/psalm: ^4.30
- 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-12-12 22:29:30 UTC
README
webclient/ext-cookie
Cookie extension for PSR-18 HTTP client.
Install
Install this package and your favorite psr-18 implementation.
composer require webclient/ext-cookie:^2.0
Using
<?php use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; use Webclient\Extension\Cookie\CookieClientDecorator; use Webclient\Extension\Cookie\Cookie\Storage; /** * @var ClientInterface $client Your PSR-18 HTTP Client * @var Storage $storage Cookies storage. You may extends this class for implements your storage */ $http = new CookieClientDecorator($client, $storage); /** @var RequestInterface $request */ $response = $http->sendRequest($request);
Provided cookies stores
\Webclient\Extension\Cookie\Cookie\ArrayStorage
- Cookies stored in memory.\Webclient\Extension\Cookie\Cookie\NetscapeCookieFile
- Cookies stored in a file (format).