Skip to content

Commit

Permalink
Merge pull request #141 from mallorymallory/patch-1
Browse files Browse the repository at this point in the history
Change GET parameters from requests data to urlencoded
  • Loading branch information
veox committed Feb 1, 2024
2 parents 4bd634a + f59107b commit 3407830
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions krakenex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,11 @@ def _query(self, urlpath, data, headers=None, timeout=None):

url = self.uri + urlpath

# Since January 2024, public endpoints only support GET.
if '/public/' in urlpath:
call_function = self.session.get
else:
call_function = self.session.post

self.response = call_function(url, data = data, headers = headers,
timeout = timeout)
# Since January 2024, public endpoints only support GET.
if '/public/' in urlpath:
self.response = self.session.get(url, params = data, headers = headers, timeout = timeout)
else:
self.response = self.session.post(url, data = data, headers = headers, timeout = timeout)

if self.response.status_code not in (200, 201, 202):
self.response.raise_for_status()
Expand Down

0 comments on commit 3407830

Please sign in to comment.