Manually merge #94
This commit is contained in:
pare
61552f9f84
commit
d303afefc8
S'han modificat 1 arxius amb 7 adicions i 13 eliminacions
|
@ -1029,21 +1029,15 @@ class Mastodon:
|
||||||
|
|
||||||
response_object = None
|
response_object = None
|
||||||
try:
|
try:
|
||||||
if method == 'GET':
|
kwargs = dict(headers=headers, files=files,
|
||||||
response_object = requests.get(self.api_base_url + endpoint, params=params,
|
|
||||||
headers=headers, files=files,
|
|
||||||
timeout=self.request_timeout)
|
timeout=self.request_timeout)
|
||||||
if method == 'POST':
|
if method == 'GET':
|
||||||
response_object = requests.post(self.api_base_url + endpoint, data=params, headers=headers,
|
kwargs['params'] = params
|
||||||
files=files, timeout=self.request_timeout)
|
else:
|
||||||
|
kwargs['data'] = params
|
||||||
|
|
||||||
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)
|
||||||
|
|
||||||
|
|
Loading…
Referencia en una nova incidència