當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。