Download the PHP package jhoffland/guzzle-formatter without Composer
On this page you can find all versions of the php package jhoffland/guzzle-formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jhoffland/guzzle-formatter
More information about jhoffland/guzzle-formatter
Files in jhoffland/guzzle-formatter
Package guzzle-formatter
Short Description PHP Guzzle request/response to HTTP message formatter
License MIT
Homepage https://github.com/jhoffland/guzzle-formatter
Informations about the package guzzle-formatter
Guzzle Formatter
PHP library for formatting Guzzle requests and responses to HTTP messages.
Installation
Install this library directly with Composer:
Add --dev
if this library is not needed in a production environment.
Usage
Using middleware
Logging all requests performed and/or responses received by a Guzzle client, using middleware.
The HTTP request and/or response messages are written to the file, specified when creating the HttpFormatterMiddleware
class instance.
Available options
1. End of Line character
Available when creating an instance of ResponseFormatter
.
2. Hide sensitive headers
Available for when formatting an HTTP message with HttpFormatterMiddleware
.
The headers seen as sensitive can be found in the array Formatter::SENSITIVE_HEADERS
.
Supported PHP & package versions
This library is tested with PHP 7.4, 8.0 and 8.1.
Check the composer.json
file for the supported package versions.
Feel free to add support for additional versions to this library.
Contributing
Feel free to contribute to this library. Contribute by forking the GitHub repository and opening a pull request.
When opening a pull request, please make sure that:
- The pull request has a clear title;
- The pull request does not consist of too many (unnecessary/small) commits;
- The StyleCI analysis pass;
- The PHPUnit tests pass.
ToDo's
- [ ] Add test for formatting request when making an request to an URL without path (e.g. to https://google.com instead of to https://google.com/).
- [ ] Add test for hiding and not-hiding sensitive headers when using the
HttpFormatterMiddleware
. - [ ] Add cURL formatter.