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


Python Requester.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Requester import Requester [as 别名]
# 或者: from Requester.Requester import __init__ [as 别名]
 def __init__(self, authId, authPass):
     Requester.__init__(self, "https://mtgox.com/api/1")
     self._authKey = authId
     self._authSecret = base64.b64decode(authPass.encode())
     # for now, we will manage only EUR.
     #self._availableCurrencies = {"USD", "EUR", "JPY", "CAD", "GBP", "CHF", "RUB", "AUD", "SEK", "DKK", "HKD", "PLN", "CNY", "SGD", "THB", "NZD", "NOK"}
     self._availableCurrencies = {"EUR"}
开发者ID:PoncinMatthieu,项目名称:BTCTrader,代码行数:9,代码来源:MtGoxRequester.py

示例2: __init__

# 需要导入模块: from Requester import Requester [as 别名]
# 或者: from Requester.Requester import __init__ [as 别名]
 def __init__(self, _printing=False, _use_cache=False):
     Requester.__init__(self, _printing, _use_cache)
     
     # Table mapping response codes to messages; entries have the
     # form {code: (shortmessage, longmessage)}.
     self.responses = {
         100: ('Continue', 'Request received, please continue'),
         101: ('Switching Protocols',
               'Switching to new protocol; obey Upgrade header'),
     
         200: ('OK', 'Request fulfilled, document follows'),
         201: ('Created', 'Document created, URL follows'),
         202: ('Accepted',
               'Request accepted, processing continues off-line'),
         203: ('Non-Authoritative Information', 'Request fulfilled from cache'),
         204: ('No Content', 'Request fulfilled, nothing follows'),
         205: ('Reset Content', 'Clear input form for further input.'),
         206: ('Partial Content', 'Partial content follows.'),
     
         300: ('Multiple Choices',
               'Object has several resources -- see URI list'),
         301: ('Moved Permanently', 'Object moved permanently -- see URI list'),
         302: ('Found', 'Object moved temporarily -- see URI list'),
         303: ('See Other', 'Object moved -- see Method and URL list'),
         304: ('Not Modified',
               'Document has not changed since given time'),
         305: ('Use Proxy',
               'You must use proxy specified in Location to access this '
               'resource.'),
         307: ('Temporary Redirect',
               'Object moved temporarily -- see URI list'),
     
         400: ('Bad Request',
               'Bad request syntax or unsupported method'),
         401: ('Unauthorized',
               'No permission -- see authorization schemes'),
         402: ('Payment Required',
               'No payment -- see charging schemes'),
         403: ('Forbidden',
               'Request forbidden -- authorization will not help'),
         404: ('Not Found', 'Nothing matches the given URI'),
         405: ('Method Not Allowed',
               'Specified method is invalid for this server.'),
         406: ('Not Acceptable', 'URI not available in preferred format.'),
         407: ('Proxy Authentication Required', 'You must authenticate with '
               'this proxy before proceeding.'),
         408: ('Request Timeout', 'Request timed out; try again later.'),
         409: ('Conflict', 'Request conflict.'),
         410: ('Gone',
               'URI no longer exists and has been permanently removed.'),
         411: ('Length Required', 'Client must specify Content-Length.'),
         412: ('Precondition Failed', 'Precondition in headers is false.'),
         413: ('Request Entity Too Large', 'Entity is too large.'),
         414: ('Request-URI Too Long', 'URI is too long.'),
         415: ('Unsupported Media Type', 'Entity body in unsupported format.'),
         416: ('Requested Range Not Satisfiable',
               'Cannot satisfy request range.'),
         417: ('Expectation Failed',
               'Expect condition could not be satisfied.'),
     
         500: ('Internal Server Error', 'Server got itself in trouble'),
         501: ('Not Implemented',
               'Server does not support this operation'),
         502: ('Bad Gateway', 'Invalid responses from another server/proxy.'),
         503: ('Service Unavailable',
               'The server cannot process the request due to a high load'),
         504: ('Gateway Timeout',
               'The gateway server did not receive a timely response'),
         505: ('HTTP Version Not Supported', 'Cannot fulfill request.'),
     }
开发者ID:darkman66,项目名称:PageGet,代码行数:72,代码来源:RequesterUrllib.py

示例3: __init__

# 需要导入模块: from Requester import Requester [as 别名]
# 或者: from Requester.Requester import __init__ [as 别名]
 def __init__(self, authId, authPass):
     Requester.__init__(self, 'https://bitcoin-central.net/api/v1/')
     self.authId = authId
     self.authPass = authPass
     concat = authId + ':' + authPass
     self.authHttpBase64 = base64.b64encode(concat.encode())
开发者ID:PoncinMatthieu,项目名称:BTCTrader,代码行数:8,代码来源:BitcoinCentralRequester.py


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