Skip to content

Commit

Permalink
Change GET parameters from requests data to urlencoded
Browse files Browse the repository at this point in the history
Exchange no longer accepts parameters for GET requests in request data. Adding code to ._query to url-encode parameters passed to data, and set data to empty dict to reduce redundant data in request
  • Loading branch information
mallorymallory committed Jan 31, 2024
1 parent 9be3fb7 commit 9e8fd32
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions krakenex/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def _query(self, urlpath, data, headers=None, timeout=None):
# Since January 2024, public endpoints only support GET.
if '/public/' in urlpath:
call_function = self.session.get
get_data = urllib.parse.urlencode(data)
url += '?' + get_data
data = {}
else:
call_function = self.session.post

Expand Down

0 comments on commit 9e8fd32

Please sign in to comment.