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
评论列表
文章目录