Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Important] Switch to using GET instead of POST for GET-only endpoints #55

Merged
merged 5 commits into from
Jul 10, 2024

Conversation

AhmedZaki99
Copy link
Contributor

Issue:

Todoist developers have made a silly decision of removing support for some HTTP verbs for endpoints that accept both GET and POST. So, according to this article, some endpoints will only accept GET and the rest will only accept POST.

It was not explicitly stated in the Sync API Docs which endpoints should use GET, so, I had to look at each of their curl examples and found that the following endpoints accept GET by default:

Impact:

From the moment Todoist has made that change, all calls to the ItemsService.GetCompletedAsync method fail with the 405 Method Not Allowed, regardless of the Todoist.Net version used.

Fix:

  • A GetAsync method was added to both TodoistRestClient and TodoistClienery similar to the PostAsync method.
  • Then, each endpoint listed above was updated to use GetAsync instead of PostAsync.

Copy link

@olsh
Copy link
Owner

olsh commented Jul 10, 2024

Sorry for the delay.

Thank you again! 👍🏻

@olsh olsh merged commit 219e7ef into olsh:master Jul 10, 2024
2 checks passed
@AhmedZaki99 AhmedZaki99 deleted the patch-http-methods branch July 11, 2024 07:38
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.

2 participants