def content_type
      return nil unless response.headers
      ((response.headers.values_at('content-type', 'Content-Type').compact.first || '').split(';').first || '').strip
    end
def content_type
      return nil unless response.headers
      ((response.headers.values_at('content-type', 'Content-Type').compact.first || '').split(';').first || '').strip
    end
Attempts to determine the content type of the response.