當前位置: 首頁>>代碼示例>>Python>>正文


Python httplib.HTTPS_PORT屬性代碼示例

本文整理匯總了Python中httplib.HTTPS_PORT屬性的典型用法代碼示例。如果您正苦於以下問題:Python httplib.HTTPS_PORT屬性的具體用法?Python httplib.HTTPS_PORT怎麽用?Python httplib.HTTPS_PORT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在httplib的用法示例。


在下文中一共展示了httplib.HTTPS_PORT屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import httplib [as 別名]
# 或者: from httplib import HTTPS_PORT [as 別名]
def __init__(self, credential, uri_or_host, timeout,
      thrift_protocol, support_account_key):
    self.credential = credential
    self.uri = uri_or_host
    parsed = urlparse.urlparse(uri_or_host)
    self.scheme = parsed.scheme
    assert self.scheme in ('http', 'https')
    if self.scheme == 'http':
      self.port = parsed.port or httplib.HTTP_PORT
    elif self.scheme == 'https':
      self.port = parsed.port or httplib.HTTPS_PORT
    self.host = parsed.hostname
    self.path = parsed.path
    if parsed.query:
      self.query = parsed.query
      self.path += '?%s' % parsed.query
    self.__timeout = timeout
    self.__protocol = thrift_protocol
    self.support_account_key = support_account_key
    self.__wbuf = StringIO()
    self.__http = None
    self.__custom_headers = None
    self.__clock_offset = 0 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-python,代碼行數:25,代碼來源:emrthttpclient.py

示例2: __init__

# 需要導入模塊: import httplib [as 別名]
# 或者: from httplib import HTTPS_PORT [as 別名]
def __init__(self, credential, uri_or_host, timeout=None, thrift_protocol=ThriftProtocol.TBINARY):
    self.credential = credential
    parsed = urlparse(uri_or_host)
    self.scheme = parsed.scheme
    assert self.scheme in ('http', 'https')
    if self.scheme == 'http':
      self.port = parsed.port or httplib.HTTP_PORT
    elif self.scheme == 'https':
      self.port = parsed.port or httplib.HTTPS_PORT
    self.host = parsed.hostname
    self.path = parsed.path
    if parsed.query:
      self.path += '?%s' % parsed.query
    self.__timeout = timeout
    self.__protocol = thrift_protocol
    self.__wbuf = StringIO()
    self.__http = None
    self.__custom_headers = None
    self.__clock_offset = 0 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-python,代碼行數:21,代碼來源:sdsthttpclient.py

示例3: __init__

# 需要導入模塊: import httplib [as 別名]
# 或者: from httplib import HTTPS_PORT [as 別名]
def __init__(self, uri, timeout=None, ssl_context_factory=None):
        """Initialize a HTTP Socket.

        @param uri(str)    The http_scheme:://host:port/path to connect to.
        @param timeout   timeout in ms
        """
        parsed = urllib.parse.urlparse(uri)
        self.scheme = parsed.scheme
        assert self.scheme in ('http', 'https')
        if self.scheme == 'http':
            self.port = parsed.port or http_client.HTTP_PORT
        elif self.scheme == 'https':
            self.port = parsed.port or http_client.HTTPS_PORT
        self.host = parsed.hostname
        self.path = parsed.path
        if parsed.query:
            self.path += '?%s' % parsed.query
        self.__wbuf = BytesIO()
        self.__http = None
        self.__custom_headers = None
        self.__timeout = None
        if timeout:
            self.setTimeout(timeout)
        self._ssl_context_factory = ssl_context_factory 
開發者ID:Thriftpy,項目名稱:thriftpy2,代碼行數:26,代碼來源:http.py

示例4: __init__

# 需要導入模塊: import httplib [as 別名]
# 或者: from httplib import HTTPS_PORT [as 別名]
def __init__(self, uri_or_host, port=None, path=None):
    """THttpClient supports two different types constructor parameters.

    THttpClient(host, port, path) - deprecated
    THttpClient(uri)

    Only the second supports https.
    """
    if port is not None:
      warnings.warn(
        "Please use the THttpClient('http://host:port/path') syntax",
        DeprecationWarning,
        stacklevel=2)
      self.host = uri_or_host
      self.port = port
      assert path
      self.path = path
      self.scheme = 'http'
    else:
      parsed = urlparse.urlparse(uri_or_host)
      self.scheme = parsed.scheme
      assert self.scheme in ('http', 'https')
      if self.scheme == 'http':
        self.port = parsed.port or httplib.HTTP_PORT
      elif self.scheme == 'https':
        self.port = parsed.port or httplib.HTTPS_PORT
      self.host = parsed.hostname
      self.path = parsed.path
      if parsed.query:
        self.path += '?%s' % parsed.query
    self.__wbuf = StringIO()
    self.__http = None
    self.__timeout = None
    self.__custom_headers = None 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-python,代碼行數:36,代碼來源:THttpClient.py

示例5: __init__

# 需要導入模塊: import httplib [as 別名]
# 或者: from httplib import HTTPS_PORT [as 別名]
def __init__(self, uri_or_host, port=None, path=None):
        if port is not None:
            warnings.warn(
                "Please use the THttpClient('http://host:port/path') syntax",
                DeprecationWarning,
                stacklevel=2)
            self.host = uri_or_host
            self.port = port
            assert path
            self.path = path
            self.scheme = 'http'
        else:
            parsed = urlparse.urlparse(uri_or_host)
            self.scheme = parsed.scheme
            assert self.scheme in ('http', 'https')
            if self.scheme == 'http':
                self.port = parsed.port or httplib.HTTP_PORT
            elif self.scheme == 'https':
                self.port = parsed.port or httplib.HTTPS_PORT
            self.host = parsed.hostname
            self.path = parsed.path
            if parsed.query:
                self.path += '?%s' % parsed.query
        self.__wbuf = StringIO()
        self.__http = None
        self.__timeout = None
        self.__custom_headers = {} 
開發者ID:merkremont,項目名稱:LineVodka,代碼行數:29,代碼來源:LineTransport.py


注:本文中的httplib.HTTPS_PORT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。