public function getBodyParams()
    {
        if (is_array($this->bodyParams)) {
            return $this->bodyParams;
        }

        $content = $this->getBody()->getContents();
        $contentType = $this->headers->get('content-type');
        if ($contentType === 'application/json') {
            $bodyParams = json_decode($content, true);
            $this->bodyParams = $bodyParams ? $bodyParams : [];
        } else {
            parse_str($content, $this->bodyParams);
        }
        return $this->bodyParams;
    }