http-php/payload

A simple OOP wrapper to work with HTTP message payloads in PHP

dev-main 2023-02-04 19:59 UTC

This package is auto-updated.

Last update: 2024-03-04 22:33:27 UTC


README

Latest Version PHP Version Tests Total Downloads

This package is to allow you to create HTTP payloads in PHP, in a simple and reliable way.

Installation

composer require http-php/payload

Usage

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

Testing

To run the test suite:

composer run test

Credits

LICENSE

The MIT LIcense (MIT). Please see License File for more information.