private function getResponseType($contentType)
    {
        $length = strpos($contentType, ';') ?: null;
        $type = $length
            ? substr($contentType, 0, $length)
            : $contentType;

        return strtolower(trim($type));
    }