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


Python HTTPClient.with_config方法代码示例

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


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

示例1: setUp

# 需要导入模块: from treq.client import HTTPClient [as 别名]
# 或者: from treq.client.HTTPClient import with_config [as 别名]
 def setUp(self):
     self.pool = HTTPConnectionPool(reactor, persistent=False)
     self.client = HTTPClient.with_config(
         pool=self.pool, allow_redirects=False, reactor=reactor)
     self.resource = TxSyncMLResource(reactor)
     self.site = server.Site(self.resource)
     self.listener = reactor.listenTCP(0, self.site, interface='localhost')
     self.listener_port = self.listener.getHost().port
     self.fixtures = FixtureHelper()
     self.addCleanup(self.listener.loseConnection)
     self.addCleanup(self.pool.closeCachedConnections)
开发者ID:smn,项目名称:txsyncml,代码行数:13,代码来源:test_resource.py

示例2: _client

# 需要导入模块: from treq.client import HTTPClient [as 别名]
# 或者: from treq.client.HTTPClient import with_config [as 别名]
def _client(*args, **kwargs):
    return HTTPClient.with_config(**kwargs)
开发者ID:Julian,项目名称:treq,代码行数:4,代码来源:api.py

示例3: _client

# 需要导入模块: from treq.client import HTTPClient [as 别名]
# 或者: from treq.client.HTTPClient import with_config [as 别名]
def _client(*args, **kwargs):
    kwargs['pool'] = default_pool(kwargs.get('reactor'),
                                  kwargs.get('pool'),
                                  kwargs.get('persistent'))

    return HTTPClient.with_config(**kwargs)
开发者ID:alex,项目名称:treq,代码行数:8,代码来源:api.py

示例4: __init__

# 需要导入模块: from treq.client import HTTPClient [as 别名]
# 或者: from treq.client.HTTPClient import with_config [as 别名]
 def __init__(self, seeds=[('localhost', 4001)]):
     self.nodes = set(seeds)
     self.http_client = HTTPClient.with_config()
开发者ID:houqp,项目名称:txetcd,代码行数:5,代码来源:client.py


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