Add params keyword argument to _get method to enable use of URL parameters.
This commit is contained in:
parent
617c5a452a
commit
e94e2d4bb3
1 changed files with 3 additions and 2 deletions
|
|
@ -111,10 +111,11 @@ class Client(object):
|
||||||
def _compose_url(self, path):
|
def _compose_url(self, path):
|
||||||
return '{0}/api/{1}/{2}/{3}'.format(self.base_url, 'v2', self.username, path)
|
return '{0}/api/{1}/{2}/{3}'.format(self.base_url, 'v2', self.username, path)
|
||||||
|
|
||||||
def _get(self, path):
|
def _get(self, path, params=None):
|
||||||
response = requests.get(self._compose_url(path),
|
response = requests.get(self._compose_url(path),
|
||||||
headers=self._headers({'X-AIO-Key': self.key}),
|
headers=self._headers({'X-AIO-Key': self.key}),
|
||||||
proxies=self.proxies)
|
proxies=self.proxies,
|
||||||
|
params=params)
|
||||||
self._handle_error(response)
|
self._handle_error(response)
|
||||||
return response.json()
|
return response.json()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue