-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
The following code will fail because the current implementation expects a dictionary as the (optional) third argument to api.make_request().
params = [{'id': 1, 'enable': True},{'id': 2, 'enable': False}]
myapi.make_request('POST', '/some/path', params=params)The full traceback is (the line numbers may be a little off because I've been editing the files).
Traceback (most recent call last):
File "sigfoxapi.py", line 226, in <module>
print(sigfox.callbacks('5947bc1150057463d724131c',callbacks))
File "sigfoxapi.py", line 193, in callbacks
self._request('POST', '/devicetypes/%s/callbacks/new' % (devicetype_id), params=callbacks)
File "sigfoxapi.py", line 99, in _request
resp = self.api.make_request(method, path, params=params, headers=headers)
File "/home/mjuenemann/.virtualenvs/python-sigfox-backend-api/lib/python3.5/site-packages/drest/api.py", line 200, in make_request
return self.request.make_request(method, url, params, headers)
File "/home/mjuenemann/.virtualenvs/python-sigfox-backend-api/lib/python3.5/site-packages/drest/request.py", line 395, in make_request
params = dict(self._extra_params, **params)
TypeError: type object argument after ** must be a mapping, not list
As a quick work-around I changed drest/request.py a bit but this will ignore self._extra_params.
It solves my immediate problem though.
if isinstance(params, dict):
params = dict(self._extra_params, **params)
Metadata
Metadata
Assignees
Labels
No labels