This package is to allow you to create HTTP payloads in PHP, in a simple and reliable way.
composer require http-php/payload
To use this package, it is very simple. Create a payload using the following code:
use HttpPHP\Payload\Payload;
$payload = Payload::make(
body: '{"test": "test"}', // add your json content here.
);
$payload->parse(); // ['test' => 'test'']; parse to get payload as an array.
This package currently supports the following payload types:
- JSON
To run the test suite:
composer run test
The MIT LIcense (MIT). Please see License File for more information.