import http.client
conn = http.client.HTTPConnection('www.python.org')
conn.request('HEAD', '/index.html')
res = conn.getresponse()
print(res.status, res.reason)
How do you send an HTTP Get Web Request in Python?