private function getResponseContentType(ResponseInterface $response):?string
    {
        $contentType = null;
        foreach ($this->listResponseHeaders($response) as $header => $value) {
            if ($header == 'Content-Type') {
                $contentType = explode(';', $value)[0];
            }
        }
        return $contentType;
    }
private function getResponseContentType(ResponseInterface $response):?string
    {
        $contentType = null;
        foreach ($this->listResponseHeaders($response) as $header => $value) {
            if ($header == 'Content-Type') {
                $contentType = explode(';', $value)[0];
            }
        }
        return $contentType;
    }
private function getResponseContentType ( ResponseInterface $ response ) : ? string { $ contentType = null ; foreach ( $ this -> listResponseHeaders ( $ response ) as $ header => $ value ) { if ( $ header == 'Content-Type' ) { $ contentType = explode ( ';' , $ value ) [ 0 ] ; } } return $ contentType ; }
Returns the response's content type. If multiple content types are present in the response headers,
the method retruns the last one.

It returns null if no content type is found in the response heaers.

@param ResponseInterface $response
@return null|string
Returns the response s content type . If multiple content types are present in the response headers the method retruns the last one .