code: def __looks_like_html(response):
          
          text = response.text.lstrip().lower()
          return text.startswith('<html') or text.startswith('<!doctype')
docs: Guesses entity type when Content-Type header is missing.
          Since Content-Type is not strictly required, some servers leave it out.