fix data passing for methods other than GET
This commit is contained in:
pare
5bc1706aa2
commit
89cbc9426a
S'han modificat 1 arxius amb 8 adicions i 3 eliminacions
|
@ -1025,10 +1025,15 @@ class Mastodon:
|
||||||
request_complete = True
|
request_complete = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response_object = requests.request(
|
kwargs = dict(headers=headers, files=files,
|
||||||
method, self.api_base_url + endpoint, params=params,
|
|
||||||
headers=headers, files=files,
|
|
||||||
timeout=self.request_timeout)
|
timeout=self.request_timeout)
|
||||||
|
if method == 'GET':
|
||||||
|
kwargs['params'] = params
|
||||||
|
else:
|
||||||
|
kwargs['data'] = params
|
||||||
|
|
||||||
|
response_object = requests.request(
|
||||||
|
method, self.api_base_url + endpoint, **kwargs)
|
||||||
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