parameters: (url, session)
docstring: Send a HEAD request to the URL, and ensure the response contains HTML.
  
      Raises `_NotHTTP` if the URL is not available for a HEAD request, or
      `_NotHTML` if the content type is not text/html.
docstring_summary: Send a HEAD request to the URL, and ensure the response contains HTML.
docstring_tokens: Send a HEAD request to the URL and ensure the response contains HTML .
function: def _ensure_html_response(url, session):
      # type: (str, PipSession) -> None
      """Send a HEAD request to the URL, and ensure the response contains HTML.
  
      Raises `_NotHTTP` if the URL is not available for a HEAD request, or
      `_NotHTML` if the content type is not text/html.
      """
      scheme, netloc, path, query, fragment = urllib_parse.urlsplit(url)
      if scheme not in {'http', 'https'}:
          raise _NotHTTP()
  
      resp = session.head(url, allow_redirects=True)
      resp.raise_for_status()
  
      _ensure_html_header(resp)
function_tokens: def _ensure_html_response ( url , session ) : # type: (str, PipSession) -> None scheme , netloc , path , query , fragment = urllib_parse . urlsplit ( url ) if scheme not in { 'http' , 'https' } : raise _NotHTTP ( ) resp = session . head ( url , allow_redirects = True ) resp . raise_for_status ( ) _ensure_html_header ( resp )