def request(self, method, params, secure=False):
"""
:param method: The endpoint to be requested.
:param params: Params to be used in request.
:param secure: Whether the method belongs to the secure or readonly service.
"""
try:
if secure:
response = self.client.secure_client.service[method](params)
else:
response = self.client.readonly_client.service[method](params)
except ConnectionError:
raise APIError(None, method, params, 'ConnectionError')
except Exception as e:
raise APIError(None, method, params, e)
data = serialize_object(response)
check_status_code(data)
return data
评论列表
文章目录