Skip to content

Commit 7567ba4

Browse files
committed
Add kwargs parameter to Diffbot.request that can be used to pass optional parameters to API
1 parent 11c736b commit 7567ba4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ class DiffbotClient(object):
55
def __init__(self):
66
self.base_url = "http://api.diffbot.com/"
77

8-
def request(self, url, token, api, fields=[], version=2):
8+
def request(self, url, token, api, fields=[], version=2, **kwargs):
99
"""
1010
Returns a python object containing the requested resource from the diffbot api
1111
"""
1212
params = {"url": url, "token": token}
1313
if fields:
1414
params['fields'] = fields
15+
if kwargs:
16+
params.update(kwargs)
1517
response = requests.get(self.compose_url(api, version), params=params)
1618
obj = response.json()
1719
return obj

0 commit comments

Comments
 (0)