Returns object HTTP header.

        Args:
            client_kwargs (dict): Client arguments.

        Returns:
            dict: HTTP header.
434999
def _head(self, client_kwargs):
        
        with _handle_oss_error():
            bucket = self._get_bucket(client_kwargs)

            # Object
            if 'key' in client_kwargs:
                return bucket.head_object(
                    key=client_kwargs['key']).headers

            # Bucket
            return bucket.get_bucket_info().headers
957877
def _http_request(self, service_type, **kwargs):
        
        request_params = urlencode(kwargs)
        request_params = request_params.replace('%28', '').replace('%29', '')

        uri = '%s%s?api_key=%s&%s' % \
            (self.base_url, service_type, self.api_key, request_params)
        header, response = self.conn.request(uri, method='GET')
        return header, response
155793
def request_headers(self, request):
        
        headers = {}

        allow_origin = self.allow_origin(request)
        if allow_origin:
            headers = dict_filter({
                'Access-Control-Allow-Origin': allow_origin,
                'Access-Control-Allow-Credentials': {True: 'true', False: 'false'}.get(self.allow_credentials),
                'Access-Control-Expose-Headers': ', '.join(self.expose_headers) if self.expose_headers else None,
            })

        return headers
818067
def build_request(self):
        """"""
        clientheaders = {}
        if (self.parent_url and
            self.parent_url.lower().startswith(HTTP_SCHEMAS)):
            clientheaders["Referer"] = self.parent_url
        kwargs = dict(
            method='GET',
            url=self.url,
            headers=clientheaders,
        )
        if self.auth:
            kwargs['auth'] = self.auth
        log.debug(LOG_CHECK, "Prepare request with %s", kwargs)
        request = requests.Request(**kwargs)
        return self.session.prepare_request(request)
278929
def get_kwargs(self):
        
        return {
            'host': self.host,
            'port': self.port,
            'channel': self.channel,
            'password': self.password
        }
195206
def _get_bucket(self, client_kwargs):
        
        return _oss.Bucket(self.client, endpoint=self._endpoint,
                           bucket_name=client_kwargs['bucket_name'])
1128640
def get_client_data(self, client):
        
        data = self._request('GET', '/clients/{}'.format(client))
        return data.json()
1271705
def getheader(self, header, default=None):
        '''
        
        '''
        if isinstance(header, str):
            return self.headers.get(header.lower(), default)
        return self.__rawheaders.get(header, default)
619309
def get_header(request, header_service):
    
    service = request.META.get('HTTP_{}'.format(header_service), b'')
    if isinstance(service, str):
        # Work around django test client oddness
        service = service.encode(HTTP_HEADER_ENCODING)
    return service
1141253
def refresh_token(self, headers=None, **kwargs):
        
        self._check_configuration("site", "token_url", "client_id",
                                  "client_secret")
        url = "%s%s" % (self.site, quote(self.token_url))
        data = {
            'client_id': self.client_id,
            'client_secret': self.client_secret,
        }
        data.update(kwargs)

        return self._make_request(url, data=data, headers=headers)
1042
def get_request(request_url, request_headers=dict()):
    
    request = Request(request_url)
    for key, val in request_headers.items():
        request.add_header(key, val)

    try:
        response = urlopen(request, timeout=_REQUEST_TIMEOUT)
        response_content = response.read()
    except (HTTPError, URLError, socket.timeout):
        response_content = None

    return response_content
827480
def get_request_headers(self, *args, **kwds):
        
        if self.request_headers:
            return self._unpack_headers(self.request_headers)
1333871
def api_request(*args, **kwargs):
        
        r = requests.request(*args, **kwargs)
        return APIResponse(r)
18846
def http_client(self):
        ''''''
        client = http.HttpClient(decompress=False, store_cookies=False)
        client.headers.clear()
        return client
229981
def system_headers(input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/system/headers', input_params, always_retry=always_retry, **kwargs)
591792
def _get_header(self, header):
        
        if header is None:
            html = self.header()
        else:
            html = header
        return html
405401
def _head(self, client_kwargs):
        
        with _handle_client_exception():
            # Object
            if 'obj' in client_kwargs:
                return self.client.head_object(**client_kwargs)

            # Container
            return self.client.head_container(**client_kwargs)