Skip to content

Commit

Permalink
Create default params
Browse files Browse the repository at this point in the history
  • Loading branch information
richardhallett committed Feb 2, 2021
1 parent cc2ae91 commit 4ea8144
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions viringo/services/datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,14 +359,16 @@ def api_get_paging_with_url(url, params):
def api_call_get(url, params=None):
"""Make authenticated get request to API with params"""

if not params:
params = {}

params['disable-facets'] = True

payload_str = ''
if params:
# Construct the payload as a string
# to avoid direct urlencoding by requests library which messes up some of the params
payload_str = "&".join("%s=%s" % (k, v)
for k, v in params.items() if v is not None)
# Construct the payload as a string
# to avoid direct urlencoding by requests library which messes up some of the params
payload_str = "&".join("%s=%s" % (k, v)
for k, v in params.items() if v is not None)

response = requests.get(
url,
Expand Down

0 comments on commit 4ea8144

Please sign in to comment.