Send params as part of the query in GET requests
Using the data argument will send them form-encoded like for the other requests, which isn't parsed by many servers for GET requests.
This commit is contained in:
pare
c8490be2a7
commit
71d1038b32
S'han modificat 1 arxius amb 1 adicions i 1 eliminacions
|
@ -923,7 +923,7 @@ class Mastodon:
|
||||||
response_object = None
|
response_object = None
|
||||||
try:
|
try:
|
||||||
if method == 'GET':
|
if method == 'GET':
|
||||||
response_object = requests.get(self.api_base_url + endpoint, data = params, headers = headers, files = files, timeout = self.request_timeout)
|
response_object = requests.get(self.api_base_url + endpoint, params = params, headers = headers, files = files, timeout = self.request_timeout)
|
||||||
|
|
||||||
if method == 'POST':
|
if method == 'POST':
|
||||||
response_object = requests.post(self.api_base_url + endpoint, data = params, headers = headers, files = files, timeout = self.request_timeout)
|
response_object = requests.post(self.api_base_url + endpoint, data = params, headers = headers, files = files, timeout = self.request_timeout)
|
||||||
|
|
Loading…
Referencia en una nova incidència