Download the PHP package phpexperts/rest-speaker without Composer
On this page you can find all versions of the php package phpexperts/rest-speaker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phpexperts/rest-speaker
More information about phpexperts/rest-speaker
Files in phpexperts/rest-speaker
Package rest-speaker
Short Description A quick and easy GuzzleHTTP extension for effortlessly handling RESTful APIs.
License MIT
Homepage https://www.phpexperts.pro/
Informations about the package rest-speaker
RESTSpeaker
RESTSpeaker is a PHP Experts, Inc., Project meant to ease the accessing of APIs.
This library's Speaker classes utilize the Guzzle HTTP Client via the Composition architectural pattern.
It further extends base Guzzle so that it automagically decodes JSON responses and is much easier to work with.
Installation
Via Composer
Change log
Version 2.6.0
- [2024-03-29 20:03:40 CDT] Return the raw data if it is not JSON.
- [2024-03-29 20:05:27 CDT] Added PHP 8.3 support.
Version 2.5.0
- [2023-01-30 10:22:26 CDT] Removed the need to override the RESTAuth methods.
- [2023-01-30 10:21:58 CDT] [m] Upgraded to phpunit v9.5.
- [2023-01-30 09:57:09 CDT] Added a NoAuth class.
Please see the changelog for more information on what has changed recently.
Usage
Comparison to Guzzle
Use cases
PHPExperts\RESTSpeaker\Tests\HTTPSpeaker
✔ Works as a Guzzle proxy
✔ Identifies as its own user agent
✔ Requests the text/html Content-Type
✔ Can get the last raw response
✔ Can get the last status code
PHPExperts\RESTSpeaker\Tests\RESTAuth
✔ Cannot build itself
✔ Children can build themselves
✔ Will not allow invalid auth modes
✔ Can set a custom api client
✔ Wont call a nonexisting auth strat
✔ Supports no auth
✔ Supports XAPI Token auth
✔ Supports custom auth strategies
✔ Has its own env() polyfill
✔ Implements Guzzle's PSR-18 ClientInterface interface.
PHPExperts\RESTSpeaker\Tests\RESTSpeaker
✔ Can build itself
✔ Returns null when no content
✔ Returns exact unmodified data when not JSON
✔ JSON URLs return plain PHP arrays
✔ Can fall down to HTTPSpeaker
✔ Requests the application/json Content-Type
✔ Can get the last raw Guzzle response
✔ Can get the last status code
✔ Will automagically pass arrays as JSON via POST, PATCH and PUT.
✔ Will automagically pass objects as JSON via POST, PATCH and PUT.
✔ Implements Guzzle's PSR-18 ClientInterface interface.
Testing
Contributors
Theodore R. Smith [email protected]
GPG Fingerprint: 4BF8 2613 1C34 87AC D28F 2AD8 EB24 A91D D612 5690
CEO: PHP Experts, Inc.
License
MIT license. Please see the license file for more information.