1. Go to this page and download the library: Download middlewares/payload library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
middlewares / payload example snippets
Dispatcher::run([
(new Middlewares\JsonPayload())
->associative(false)
->depth(64)
]);
$response = $dispatcher->dispatch(new ServerRequest());
//Disable associative arrays
$payload = (new Middlewares\JsonPayload())->associative(false);
//Parse json only with POST and PUT requests
$payload = (new Middlewares\JsonPayload())->methods(['POST', 'PUT']);
//Parse json only in request with these two Content-Type values
$payload = (new Middlewares\JsonPayload())->contentType(['application/json', 'text/json']);
Dispatcher::run([
new Middlewares\UrlEncodePayload()
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.