Equip\Input::body PHP Method

body() private method

private body ( Psr\Http\Message\ServerRequestInterface $request ) : array
$request Psr\Http\Message\ServerRequestInterface
return array
    private function body(ServerRequestInterface $request)
    {
        $body = $request->getParsedBody();
        if (empty($body)) {
            return [];
        }
        if (is_object($body)) {
            // Because the parsed body may also be represented as an object,
            // additional parsing is required. This is a bit dirty but works
            // very well for anonymous objects.
            $body = json_decode(json_encode($body), true);
        }
        return $body;
    }