fix data passing for methods other than GET

This commit is contained in:
codl 2017-10-04 16:24:37 +02:00
pare 5bc1706aa2
commit 89cbc9426a
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: 6CD7C8891ED1233A

Veure arxiu

@ -1025,10 +1025,15 @@ class Mastodon:
request_complete = True
try:
response_object = requests.request(
method, self.api_base_url + endpoint, params=params,
headers=headers, files=files,
kwargs = dict(headers=headers, files=files,
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:
raise MastodonNetworkError("Could not complete request: %s" % e)