Makes a ``HEAD`` requests to the URI.

        :returns: ``True`` if status code is 2xx.
7004
def dir_exists(self):
        

        r = requests.request(self.method if self.method else 'HEAD', self.url, **self.storage_args)
        try: r.raise_for_status()
        except Exception: return False

        return True
1264760
def is_response_to_head(response):
    
    # FIXME: Can we do this somehow without accessing private httplib _method?
    method = response._method
    if isinstance(method, int):  # Platform-specific: Appengine
        return method == 3
    return method.upper() == 'HEAD'
825586
def head_object_async(self, path, **kwds):
    
    return self.do_request_async(self.api_url + path, 'HEAD', **kwds)
1280938
def header_status(header):
    """"""
    status_line = header[:header.find('\r')]
    # 'HTTP/1.1 200 OK' -> (200, 'OK')
    fields = status_line.split(None, 2)
    return int(fields[1]), fields[2]
1066920
def Uri(self):
		
		return ("%s://%s%s" % (("https", "http")[self._noSsl == True], self._name, (":" + str(self._port), "")[
			(((self._noSsl == False) and (self._port == 80)) or ((self._noSsl == True) and (self._port == 443)))]))
1024094
def _head(self, uri):
        
        resp, resp_body = self.api.method_head(uri)
        return resp
76228
def _generate_response_head_bytes(status_code, headers):
    

    head_string = str(status_code) + _DELIMITER_NEWLINE
    header_tuples = sorted((k, headers[k]) for k in headers)

    for name, value in header_tuples:
        name = _get_header_correctly_cased(name)

        if _should_sign_response_header(name):
            head_string += _FORMAT_HEADER_STRING.format(name, value)

    return (head_string + _DELIMITER_NEWLINE).encode()
1313163
def head(path, options = {}, &block)
      ensure_method_maintained_across_redirects options
      perform_request Net::HTTP::Head, path, options, &block
    end
422624
private void checkHead(Token token, Optional<Integer> optHead) {
        if (optHead.isPresent()) {
            int head = optHead.get();
            Preconditions.checkArgument(head >= 0 && head <= tokens.size(), String.format("Head should refer to token or 0: %s", token));
        }
    }
578910
def head(self, *args, **kwargs):
        
        return self.session.head(*args, **self.get_kwargs(**kwargs))
568796
def required_header(header):
    
    if header in IGNORE_HEADERS:
        return False

    if header.startswith('HTTP_') or header == 'CONTENT_TYPE':
        return True

    return False
1314479
def _should_sign_response_header(header_name):
    

    if header_name == _HEADER_SERVER_SIGNATURE:
        return False

    if re.match(_PATTERN_HEADER_PREFIX_BUNQ, header_name):
        return True

    return False
1267052
def is_rate_limited(response):
        
        if (response.status_code == codes.too_many_requests and 'Retry-After' in response.headers and
                int(response.headers['Retry-After']) >= 0):
            return True

        return False
1179118
def check_exists(self):

		'''
		
		'''

		response = self.repo.api.http_request('HEAD', self.uri)
		self.status_code = response.status_code
		# resource exists
		if self.status_code == 200:
			self.exists = True
		# resource no longer here
		elif self.status_code == 410:
			self.exists = False
		# resource not found
		elif self.status_code == 404:
			self.exists = False
		return self.exists
830887
def head(self, *args, **kwargs):
        
        # Create the model and fetch its data
        self.model = self.get_model(kwargs.get('id'))
        result = yield self.model.fetch()

        # If model is not found, return 404
        if not result:
            self.not_found()
            return

        # Stub to check for read permissions
        if not self.has_read_permission():
            self.permission_denied()
            return

        # Add the headers (etag, content-length), set the status
        self.add_headers()
        self.set_status(200)
        self.finish()
627306
protected static function allowHeaders()
    {
        if (self::$needHeaders !== null) {
            return self::$needHeaders;
        }

        return self::$needHeaders = Request::is('GET') || Request::is('HEAD');
    }
1296271
def request_head(path, initheader = nil, &block)
      request(Head.new(path, initheader), &block)
    end