protected function getContentType(ResponseInterface $response)
    {
        // Check for an accept header
        if ($response->hasHeader('Content-Type')) {
            // Get the first part of the header, for example: exclude charset=utf-8

            $header = $response->getHeaderLine('Content-Type');
            $parts = explode(';', $header);
            return trim($parts[0]);
        }

        return null;
    }