Manually merge #94

This commit is contained in:
Lorenz Diener 2017-11-21 13:53:42 +01:00
pare 61552f9f84
commit d303afefc8

Veure arxiu

@ -1029,21 +1029,15 @@ class Mastodon:
response_object = None response_object = None
try: try:
kwargs = dict(headers=headers, files=files,
timeout=self.request_timeout)
if method == 'GET': if method == 'GET':
response_object = requests.get(self.api_base_url + endpoint, params=params, kwargs['params'] = params
headers=headers, files=files, else:
timeout=self.request_timeout) kwargs['data'] = params
if method == 'POST':
response_object = requests.post(self.api_base_url + endpoint, data=params, headers=headers,
files=files, timeout=self.request_timeout)
if method == 'PATCH': response_object = requests.request(
response_object = requests.patch(self.api_base_url + endpoint, data=params, headers=headers, method, self.api_base_url + endpoint, **kwargs)
files=files, timeout=self.request_timeout)
if method == 'DELETE':
response_object = requests.delete(self.api_base_url + endpoint, data=params, headers=headers,
files=files, timeout=self.request_timeout)
except Exception as e: except Exception as e:
raise MastodonNetworkError("Could not complete request: %s" % e) raise MastodonNetworkError("Could not complete request: %s" % e)