Added a fix when sending params to the API
This commit is contained in:
parent
ca584301e7
commit
05cb2b3c73
@ -49,7 +49,7 @@ class Session(object):
|
|||||||
|
|
||||||
def get(self, method, **params):
|
def get(self, method, **params):
|
||||||
""" Helper for all GET methods. This should not be used directly. """
|
""" Helper for all GET methods. This should not be used directly. """
|
||||||
response = self.http.get(self.instance_endpoint+self.API_PREFIX+self.API_VERSION+method, data=params)
|
response = self.http.get(self.instance_endpoint+self.API_PREFIX+self.API_VERSION+method, params=params)
|
||||||
if response.ok == False:
|
if response.ok == False:
|
||||||
raise APIError("Error {error_code}: {text}".format(error_code=response.status_code, text=response.text))
|
raise APIError("Error {error_code}: {text}".format(error_code=response.status_code, text=response.text))
|
||||||
return response.json()
|
return response.json()
|
||||||
@ -65,9 +65,6 @@ class Session(object):
|
|||||||
method = method.replace("/libraries", "/{id}/libraries".format(id=args[0]))
|
method = method.replace("/libraries", "/{id}/libraries".format(id=args[0]))
|
||||||
else:
|
else:
|
||||||
method = method+"/{id}".format(id=args[0])
|
method = method+"/{id}".format(id=args[0])
|
||||||
print(method)
|
|
||||||
print(args)
|
|
||||||
print(kwargs)
|
|
||||||
result = getattr(self, extension)(method=method, **kwargs)
|
result = getattr(self, extension)(method=method, **kwargs)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user