hskrasek / guzzle-sunset
Requires
- guzzlehttp/guzzle: ~6.0
- psr/log: ^1.0
Requires (Dev)
- php: >=7.0.0
- phpunit/phpunit: ^6.3
This package is auto-updated.
Last update: 2025-02-25 01:35:00 UTC
README
Watch out for Sunset headers on HTTP responses, as they signify the deprecation (and eventual removal) of an endpoint.
Sunset is an in-development RFC for a HTTP response header, currently v03. Check out GitHub for issues and discussion around it's development.
This specification defines the Sunset HTTP response header field, which indicates that a URI is likely to become unresponsive at a specified point in the future.
The header we're sniffing for looks a little like this:
Sunset: Sat, 31 Dec 2018 23:59:59 GMT
So long as the server being called is inserting a Sunset
header to the response with a HTTP date, this client-side code will do stuff.
Install
Via Composer
composer require hskrasek/guzzle-sunset
Usage
$stack = new \GuzzleHttp\HandlerStack(\GuzzleHttp\choose_handler()); $stack->push(new \HSkrasek\Sunset\SunsetMiddleware($somePsr3Logger)); $client = new \GuzzleHttp\Client(['handler' => $stack]);
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Bug reports and pull requests are welcome on GitHub at hskrasek/guzzle-sunset. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.