本文整理汇总了Python中six.moves.http_client.HTTPConnection.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python HTTPConnection.__init__方法的具体用法?Python HTTPConnection.__init__怎么用?Python HTTPConnection.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类six.moves.http_client.HTTPConnection
的用法示例。
在下文中一共展示了HTTPConnection.__init__方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from six.moves.http_client import HTTPConnection [as 别名]
# 或者: from six.moves.http_client.HTTPConnection import __init__ [as 别名]
def __init__(self, host, port=None, key_file=None, cert_file=None,
ca_certs=None, strict=None, **kwargs):
if six.PY2:
HTTPConnection.__init__(self, host=host, port=port, strict=strict, **kwargs)
else:
# python3's HTTPConnection dropped the strict argument.
HTTPConnection.__init__(self, host=host, port=port, **kwargs)
self.key_file = key_file
self.cert_file = cert_file
self.ca_certs = ca_certs
if self.ca_certs:
self.cert_reqs = ssl.CERT_REQUIRED
else:
self.cert_reqs = ssl.CERT_NONE
示例2: __init__
# 需要导入模块: from six.moves.http_client import HTTPConnection [as 别名]
# 或者: from six.moves.http_client.HTTPConnection import __init__ [as 别名]
def __init__(self, path):
HTTPConnection.__init__(self, 'localhost')
self.path = path