当前位置: 首页>>代码示例>>Python>>正文


Python compat.HTTPHeaders方法代码示例

本文整理汇总了Python中botocore.compat.HTTPHeaders方法的典型用法代码示例。如果您正苦于以下问题:Python compat.HTTPHeaders方法的具体用法?Python compat.HTTPHeaders怎么用?Python compat.HTTPHeaders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在botocore.compat的用法示例。


在下文中一共展示了compat.HTTPHeaders方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from botocore import compat [as 别名]
# 或者: from botocore.compat import HTTPHeaders [as 别名]
def __init__(self, *args, **kwargs):
        self.auth_path = None
        if 'auth_path' in kwargs:
            self.auth_path = kwargs['auth_path']
            del kwargs['auth_path']
        models.Request.__init__(self, *args, **kwargs)
        headers = HTTPHeaders()
        if self.headers is not None:
            for key, value in self.headers.items():
                headers[key] = value
        self.headers = headers
        # This is a dictionary to hold information that is used when
        # processing the request. What is inside of ``context`` is open-ended.
        # For example, it may have a timestamp key that is used for holding
        # what the timestamp is when signing the request. Note that none
        # of the information that is inside of ``context`` is directly
        # sent over the wire; the information is only used to assist in
        # creating what is sent over the wire.
        self.context = {} 
开发者ID:skarlekar,项目名称:faces,代码行数:21,代码来源:awsrequest.py

示例2: headers_to_sign

# 需要导入模块: from botocore import compat [as 别名]
# 或者: from botocore.compat import HTTPHeaders [as 别名]
def headers_to_sign(self, request):
        """
        Select the headers from the request that need to be included
        in the StringToSign.
        """
        header_map = HTTPHeaders()
        for name, value in request.headers.items():
            lname = name.lower()
            if lname not in SIGNED_HEADERS_BLACKLIST:
                header_map[lname] = value
        if 'host' not in header_map:
            # Ensure we sign the lowercased version of the host, as that
            # is what will ultimately be sent on the wire.
            # TODO: We should set the host ourselves, instead of relying on our
            # HTTP client to set it for us.
            header_map['host'] = self._canonical_host(request.url).lower()
        return header_map 
开发者ID:QData,项目名称:deepWordBug,代码行数:19,代码来源:auth.py

示例3: headers_to_sign

# 需要导入模块: from botocore import compat [as 别名]
# 或者: from botocore.compat import HTTPHeaders [as 别名]
def headers_to_sign(self, request):
        """
        Select the headers from the request that need to be included
        in the StringToSign.
        """
        header_map = HTTPHeaders()
        split = urlsplit(request.url)
        for name, value in request.headers.items():
            lname = name.lower()
            if lname not in SIGNED_HEADERS_BLACKLIST:
                header_map[lname] = value
        if 'host' not in header_map:
            header_map['host'] = split.netloc
        return header_map 
开发者ID:skarlekar,项目名称:faces,代码行数:16,代码来源:auth.py

示例4: headers_to_sign

# 需要导入模块: from botocore import compat [as 别名]
# 或者: from botocore.compat import HTTPHeaders [as 别名]
def headers_to_sign(self, request):
        """
        Select the headers from the request that need to be included
        in the StringToSign.
        """
        header_map = HTTPHeaders()
        for name, value in request.headers.items():
            lname = name.lower()
            if lname not in SIGNED_HEADERS_BLACKLIST:
                header_map[lname] = value
        if 'host' not in header_map:
            header_map['host'] = self._canonical_host(request.url)
        return header_map 
开发者ID:VirtueSecurity,项目名称:aws-extender,代码行数:15,代码来源:auth.py


注:本文中的botocore.compat.HTTPHeaders方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。