def _headers(self, host, name):
        '''
        Gets headers of an HTTP response for a given file name using HEAD
        request. Used in `exists` and `size`.
        '''
        http = httplib2.Http(timeout=self.timeout)
        url = self._get_url(host, name)
        response, response_body = http.request(url, 'HEAD')
        if response.status >= 400 and response.status != 404:
            raise HTTPError('HEAD', url, response.status)
        return response

    # Public interface of a transport. Transport should support following
    # methods:
    #
    # - put     uploading a file
    # - delete  deleting a file
    # - get     getting a file's contents
    # - exists  test if a file exists
    # - size    get a file size
    #
    # All methods are free to raise appropriate exceptions if some functionality
    # is not supported.
dataset/ETHPy150Open isagalaev/django_dust/django_dust/http.py/HTTPTransport._headers/original