takos22 / codingame

Wrapper for the undocumented CodinGame API. Can be used both synchronously and asynchronlously.
https://codingame.readthedocs.io
MIT License
21 stars 7 forks source link

[FEAT] Make Client useable for any authenticated POST request #7

Closed darthwalsh closed 2 years ago

darthwalsh commented 2 years ago

Is your feature request related to a problem? Please describe. I made a small app that downloads all my CodinGame solutions. I need to make authenticated API requests to different URLs e.g. https://www.codingame.com/services/Puzzle/findAllMinimalProgress, /Solution/findSolution, etc.

I've now blocked with the login problem #5 and at the same time I was guessing about some solution you were building it! (wow!)

Describe the solution you'd like Add codingame.Client.request(service: str, func: str, json: list = []) to the public API for both the sync and async clients.

Describe alternatives you've considered

Additional context I'm impressed by this project! Nice!

takos22 commented 2 years ago

Currently the only way is to use the internal HTTPClient with client._state.http.request(...), but I'll probably add client.request as an alias for it. I'm also planning on adding the endpoints that you use but that will take more time, because I want to finish the notifications first and then I'll work on puzzle related endpoints. Thanks for the ideas and feedback.

takos22 commented 2 years ago

The next release (1.2.0) will implement Client.request and it will probably come out today. Join the discord server if you want to be notified of the release.