weiboarc.py 文件源码

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

项目:sfm-weibo-harvester 作者: gwu-libraries 项目源码 文件源码
def get(self, uri, **kwargs):
        """
        Request resource by get method.
        """
        # 500 test url
        # self.api_url='https://httpbin.org/status/500'

        url = "{0}{1}.json".format(self.api_url, uri)

        res = self.session.get(url, params=kwargs)
        # other error code with server will be deal in low level app
        # 403 for invalid access token and rate limit
        # 400 for information of expire token
        if res.status_code in [200, 400, 403]:
            self._assert_error(res.json())
        return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号