src/Http/ServerRequest.php
public function getParsedBody()
    {
        $content_type = array_map('trim', explode(
            ';',
            $this->params['CONTENT_TYPE'] ?? ''
        ))[0];

        if (in_array($content_type, ['application/x-www-form-urlencoded', 'multipart/form-data'])) {
            return $this->stream;
        }

        switch ($content_type) {
            case 'application/json':
                return json_decode($this->stream);
                break;

            case 'application/xml':
                return new \SimpleXMLElement($this->stream);
                break;
        }

        return $this->stream;
    }
public function getParsedBody()
    {
        $content_type = array_map('trim', explode(
            ';',
            $this->params['CONTENT_TYPE'] ?? ''
        ))[0];

        if (in_array($content_type, ['application/x-www-form-urlencoded', 'multipart/form-data'])) {
            return $this->stream;
        }

        switch ($content_type) {
            case 'application/json':
                return json_decode($this->stream);
                break;

            case 'application/xml':
                return new \SimpleXMLElement($this->stream);
                break;
        }

        return $this->stream;
    }
Retrieve any parameters provided in the request body.
If the request Content-Type is either application/x-www-form-urlencoded
or multipart/form-data, and the request method is POST, this method MUST
return the contents of $_POST.
Otherwise, this method may return any results of deserializing
the request body content; as parsing returns structured content, the
potential types MUST be arrays or objects only. A null value indicates
the absence of body content.

@return null|array|object The deserialized body parameters, if any.
These will typically be an array or object.