def _request(self, method, urlpath, **kwargs):
"""Makes an HTTP call using the Python requests library.
Refer to http://docs.python-requests.org/en/master/api/ for more information on supported
options and features.
Args:
method: HTTP method name as a string (e.g. get, post).
urlpath: URL path of the remote endpoint. This will be appended to the server's base URL.
kwargs: An additional set of keyword arguments to be passed into requests API
(e.g. json, params).
Returns:
dict: The parsed JSON response.
"""
resp = self._session.request(method, ID_TOOLKIT_URL + urlpath, **kwargs)
resp.raise_for_status()
return resp.json()
评论列表
文章目录