(response)
Check the Content-Type header to ensure the response contains HTML.

    Raises `_NotHTML` if the content type is not text/html.
Check the Content-Type header to ensure the response contains HTML.
Check the Content - Type header to ensure the response contains HTML .
def _ensure_html_header(response):
    # type: (Response) -> None
    """Check the Content-Type header to ensure the response contains HTML.

    Raises `_NotHTML` if the content type is not text/html.
    """
    content_type = response.headers.get("Content-Type", "")
    if not content_type.lower().startswith("text/html"):
        raise _NotHTML(content_type, response.request.method)
def _ensure_html_header ( response ) : # type: (Response) -> None content_type = response . headers . get ( "Content-Type" , "" ) if not content_type . lower ( ) . startswith ( "text/html" ) : raise _NotHTML ( content_type , response . request . method )