Add params keyword argument to _get method to enable use of URL parameters.

This commit is contained in:
Luke McNinch 2021-02-23 21:04:35 -05:00
parent 617c5a452a
commit e94e2d4bb3

View file

@ -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()