import urllib.request, urllib.error, urllib.parse


class HeadRequest(urllib.request.Request):

    def get_method(self):
        return 'HEAD'
response = urllib.request.urlopen(HeadRequest('http://google.com/index.html'))
How do you send a HEAD HTTP request in Python 2?