# Get the content type of a URL
def get_url_type(url: str) -> str:
r = urlopen(url)
header = r.headers
return header.get_content_type()
Would the following only fetch the headers or would it fetch the whole document?
I'm using this to check if it is or not an html page, to avoid downloading (big) files.