Skip to content

Commit 16b480e

Browse files
committed
Enable multi-var URL endpoints by expecting list return
1 parent 0ce7e0b commit 16b480e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scuttle/versions/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ def __init__(self, domain, api_key):
1212
)
1313
self.api_key = api_key
1414

15-
def request(self, namespace, value=None, data=None):
15+
def request(self, namespace, values=None, data=None):
1616
method = 'get' if data is None else 'post'
17+
values = [] if values is None else values
1718
send = {'headers': {"Authorization": "Bearer {}".format(self.api_key)}}
1819
if data is not None:
1920
send['data'] = data
2021
response = getattr(requests, method)(
21-
"{}/{}".format(self.endpoint, namespace.format(value)), **send
22+
"{}/{}".format(self.endpoint, namespace.format(*values)), **send
2223
)
2324
return response.json()

0 commit comments

Comments
 (0)