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


Python HttpClient.headers['accept']方法代碼示例

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


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

示例1: setup

# 需要導入模塊: from pulsar.apps.http import HttpClient [as 別名]
# 或者: from pulsar.apps.http.HttpClient import headers['accept'] [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['accept'] [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['accept'] [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['accept']方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。