Skip to content

Conversation

@mallorymallory
Copy link
Contributor

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

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
@JGroxz
Copy link

JGroxz commented Jan 31, 2024

May I suggest to use params argument of session.get()? It also works, but results in less lines of code as you don't have to append parameters to URL manually.

That if would become:

# 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)

What do you think, @mallorymallory ?

using session.get params variable rather than url encoding to pass parameters to Kraken public GET requests - looks cleaner, fulfills same purpose

veox#140 (comment)
veox#141 (comment)
@mallorymallory
Copy link
Contributor Author

Thanks for the ping @JGroxz, agreed~
definitely cleaner :)

@veox veox merged commit 3407830 into veox:master Feb 1, 2024
veox added a commit that referenced this pull request Feb 1, 2024
Sadly, this covers up the actual fixing commit. :/ See the previous
merge, or issue #140 / PR #141 on Github.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants