summaryrefslogtreecommitdiff
path: root/tests/http/data.php
blob: 6570936a8bcabe7a9386a5f66c45531ecea792e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

function handleRequest(ServerRequestInterface $req, ResponseInterface $resp): ResponseInterface
{
    $data = $req->getParsedBody();

    ksort($data);
    ksort($data['arr']);
    ksort($data['arr']['x']['y']);

    $resp->getBody()->write(json_encode($data));

    return $resp;
}