Gets the authorization headers for a request.

        Returns:
            Sequence[Tuple[str, str]]: A list of request headers (key, value)
                to add to the request.
190135
def _get_authorization_headers(self, context):
        
        headers = {}
        self._credentials.before_request(
            self._request,
            context.method_name,
            context.service_url,
            headers)

        return list(six.iteritems(headers))
220448
def request_headers(headers = {}, auth: true, gzip: true)
      headers = default_headers.merge(headers)
      headers.merge!(bearer_authorization_header) if auth
      headers[ACCEPT_ENCODING] = GZIP if gzip
      headers.reject{|_,v| v.nil? || (v.respond_to?(:empty?) && v.empty?)}
    end
996976
def _add_auth_headers(self, base):
        """"""
        if 'access_token' in self.creds:
            return _extend(base, {
                'authorization': 'Bearer ' + self.creds['access_token']
            })
        return base
76158
def headers(self):
        
        client_headers = getattr(self.client, 'headers', {})
        return dict(self.DEFAULT_HEADERS, **client_headers)
827480
def get_request_headers(self, *args, **kwds):
        
        if self.request_headers:
            return self._unpack_headers(self.request_headers)
173932
def get_request_authorization(method, resource, key, params, headers):
        
        if not key:
            return six.b('')
        content = method + "\n"
        if 'Content-MD5' in headers:
            content += headers['Content-MD5']
        content += '\n'
        if 'Content-Type' in headers:
            content += headers['Content-Type']
        content += "\n"
        content += headers['Date'] + "\n"
        content += Util.canonicalized_log_headers(headers)
        content += Util.canonicalized_resource(resource, params)
        return Util.hmac_sha1(content, key)
987606
def get_authorizations(self):
        
        return github.PaginatedList.PaginatedList(
            github.Authorization.Authorization,
            self._requester,
            "/authorizations",
            None
        )
235862
def _get_credentials(self, request):
        
        authorization = request.headers.get('Authorization')
        if not authorization:
            return None
        try:
            authmeth, authbytes = authorization.split(' ', 1)
        except ValueError:  # not enough values to unpack
            return None
        if authmeth.lower() != 'apikey':
            return None

        if six.PY2 or isinstance(authbytes, bytes):
            try:
                auth = authbytes.decode('utf-8')
            except UnicodeDecodeError:
                auth = authbytes.decode('latin-1')
        else:
            auth = authbytes

        try:
            username, api_key = auth.split(':', 1)
        except ValueError:  # not enough values to unpack
            return None
        return username, api_key
1131601
def get(self, request):
        
        headers = {"Authorization": "Bearer " + self.token }
        g = requests.get(self.url + request, headers=headers)
        return json.loads(g.text)
409322
def _get_headers(self):
        """"""
        headers = {
            'user-agent': 'IPinfoClient/Python{version}/1.0'.format(version=sys.version_info[0]),
            'accept': 'application/json'
        }

        if self.access_token:
            headers['authorization'] = 'Bearer {}'.format(self.access_token)

        return headers
511641
def _setHeaders(self, request):
        
        request.responseHeaders.addRawHeader(b'content-type', b'application/json')
        request.responseHeaders.addRawHeader(b'Access-Control-Allow-Origin', b'*')
        request.responseHeaders.addRawHeader(b'Access-Control-Allow-Methods', b'GET, POST, PUT, DELETE')
        request.responseHeaders.addRawHeader(b'Access-Control-Allow-Headers', b'x-prototype-version,x-requested-with')
        request.responseHeaders.addRawHeader(b'Access-Control-Max-Age', 2520)
        return request
104281
def _get_default_headers(cls):
        

        return {
            cls.HEADER_USER_AGENT: cls._USER_AGENT_BUNQ,
            cls.HEADER_REQUEST_ID: cls._generate_random_request_id(),
            cls.HEADER_GEOLOCATION: cls._GEOLOCATION_ZERO,
            cls.HEADER_LANGUAGE: cls._LANGUAGE_EN_US,
            cls.HEADER_REGION: cls._REGION_NL_NL,
            cls.HEADER_CACHE_CONTROL: cls._CACHE_CONTROL_NONE,
        }
302969
def RequestPacket(self):
        
        attr = self._PktEncodeAttributes()

        if self.authenticator is None:
            self.authenticator = self.CreateAuthenticator()

        if self.id is None:
            self.id = self.CreateID()

        header = struct.pack('!BBH16s', self.code, self.id,
            (20 + len(attr)), self.authenticator)

        return header + attr
314381
def GetHTTPHeaders(self):
    
    http_headers = self._adwords_client.oauth2_client.CreateHttpHeader()
    if self.enable_compression:
      http_headers['accept-encoding'] = 'gzip'

    http_headers.update(self.custom_http_headers)

    return http_headers
92645
def headers(self):
        """"""
        self._headers.update(**{'Accept-Language': self.language})
        if self.__token:
            self._headers.update(
                **{'Authorization': 'Bearer %s' % self.__token})
        return self._headers
1052861
def get_headers(environ):
    
    for key, value in environ.iteritems():
        key = str(key)
        if key.startswith('HTTP_') and key not in \
           ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH'):
            yield key[5:].replace('_', '-').title(), value
        elif key in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
            yield key.replace('_', '-').title(), value
8578
def parse_request_headers(headers):
    
    request_header_keys = set(headers.keys(lower=True))
    request_meta_keys = set(XHEADERS_TO_ARGS_DICT.keys())
    data_header_keys = request_header_keys.intersection(request_meta_keys)
    return dict(([XHEADERS_TO_ARGS_DICT[key],
                  headers.get(key, None)] for key in data_header_keys))