Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feature.issue_request_params -> develop #1

Merged
merged 2 commits into from
Mar 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions figshare/figshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import os
from urllib.request import urlretrieve

def issue_request(method, url, headers, data=None, binary=False):

def issue_request(method, url, headers, data=None, binary=False,
params=None):
"""Wrapper for HTTP request

Parameters
Expand All @@ -24,6 +26,9 @@ def issue_request(method, url, headers, data=None, binary=False):
binary: bool
Whether data is binary or not

params: dict
Additional information for URL GET request

Returns
-------
response_data: dict
Expand All @@ -32,7 +37,8 @@ def issue_request(method, url, headers, data=None, binary=False):
if data is not None and not binary:
data = json.dumps(data)

response = requests.request(method, url, headers=headers, data=data)
response = requests.request(method, url, headers=headers,
data=data, params=params)

try:
response.raise_for_status()
Expand Down