Skip to content

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

Merged
olsh merged 5 commits into
olsh:masterfrom
AhmedZaki99:patch-http-methods
Jul 10, 2024
Merged

[Important] Switch to using GET instead of POST for GET-only endpoints#55
olsh merged 5 commits into
olsh:masterfrom
AhmedZaki99:patch-http-methods

Conversation

@AhmedZaki99
Copy link
Copy Markdown
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.

@sonarqubecloud
Copy link
Copy Markdown

@olsh
Copy link
Copy Markdown
Owner

olsh commented Jul 10, 2024

Sorry for the delay.

Thank you again! 👍🏻

@olsh olsh merged commit 219e7ef into olsh:master Jul 10, 2024
@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