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


Python HttpClient.headers['content-type']方法代码示例

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


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

示例1: setup

# 需要导入模块: from pulsar.apps.http import HttpClient [as 别名]
# 或者: from pulsar.apps.http.HttpClient import headers['content-type'] [as 别名]
 def setup(self, http=None, timeout=None, **kw):
     if not http:
         timeout = timeout if timeout is not None else self.default_timeout
         http = HttpClient(timeout=timeout, **kw)
     http.headers['accept'] = 'application/json, text/*; q=0.5'
     http.headers['content-type'] = 'application/json'
     self.local.http = http
开发者ID:BazookaShao,项目名称:pulsar,代码行数:9,代码来源:jsonrpc.py

示例2: __init__

# 需要导入模块: from pulsar.apps.http import HttpClient [as 别名]
# 或者: from pulsar.apps.http.HttpClient import headers['content-type'] [as 别名]
 def __init__(self, url, version=None, data=None,
              full_response=False, http=None, timeout=None, **kw):
     self._url = url
     self._version = version or self.__class__.default_version
     self._full_response = full_response
     self._data = data if data is not None else {}
     if not http:
         timeout = timeout if timeout is not None else self.default_timeout
         http = HttpClient(timeout=timeout, **kw)
     http.headers['accept'] = 'application/json, text/*; q=0.5'
     http.headers['content-type'] = 'application/json'
     self._http = http
开发者ID:axisofentropy,项目名称:pulsar,代码行数:14,代码来源:jsonrpc.py

示例3: __init__

# 需要导入模块: from pulsar.apps.http import HttpClient [as 别名]
# 或者: from pulsar.apps.http.HttpClient import headers['content-type'] [as 别名]
 def __init__(self, url, version=None, data=None,
              full_response=False, http=None, timeout=None, sync=False,
              loop=None, encoding='ascii', **kw):
     self.sync = sync
     self._url = url
     self._version = version or self.__class__.default_version
     self._full_response = full_response
     self._data = data if data is not None else {}
     if not http:
         timeout = timeout if timeout is not None else self.default_timeout
         if sync and not loop:
             loop = new_event_loop()
         http = HttpClient(timeout=timeout, loop=loop, **kw)
     http.headers['accept'] = 'application/json, text/*; q=0.5'
     http.headers['content-type'] = 'application/json'
     self._http = http
     self._encoding = encoding
开发者ID:wilddom,项目名称:pulsar,代码行数:19,代码来源:jsonrpc.py


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