def __init__(self, url_scheme=DEFAULT_SCHEME):
self.session = Session()
requests = self._get_global_requests_module()
# Methods to replace
self.methods = ('request', 'get', 'head', 'post',
'patch', 'put', 'delete', 'options')
# Store the original methods
self.orig_methods = dict(
(m, requests.__dict__[m]) for m in self.methods)
# Monkey patch
g = globals()
for m in self.methods:
requests.__dict__[m] = g[m]
__init__.py 文件源码
python
阅读 35
收藏 0
点赞 0
评论 0
评论列表
文章目录