__init__.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:mygene.py 作者: biothings 项目源码 文件源码
def _post(self, url, params, verbose=True):
        return_raw = params.pop('return_raw', False)
        headers = {'content-type': 'application/x-www-form-urlencoded',
                   'user-agent': "mygene.py/%s python-requests/%s" % (__version__, requests.__version__)}
        res = requests.post(url, data=params, headers=headers)
        from_cache = getattr(res, 'from_cache', False)
        if self.raise_for_status:
            # raise requests.exceptions.HTTPError if not 200
            res.raise_for_status()
        if return_raw:
            return from_cache, res
        ret = res.json()
        return from_cache, ret
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号