[Important] Switch to using GET instead of POST for GET-only endpoints#55
Merged
Conversation
And consequently, removed the `ProcessPostAsync` method from `IAdvancedTodoistClient`, for not being used publicly.
|
Owner
|
Sorry for the delay. Thank you again! 👍🏻 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issue:
Todoist developers have made a silly decision of removing support for some HTTP verbs for endpoints that accept both
GETandPOST. So, according to this article, some endpoints will only acceptGETand the rest will only acceptPOST.It was not explicitly stated in the Sync API Docs which endpoints should use
GET, so, I had to look at each of theircurlexamples and found that the following endpoints acceptGETby default:projects/get_archived(#get-archived-projects)completed/get_all(#get-all-completed-items)uploads/get(#get-uploads)activity/get(#get-activity-logs)backups/get(#get-backups)completed/get_stats(#get-productivity-stats) [Not implemented by this package]archive/sections(#get-archived-sections) [Not implemented by this package]archive/items(#get-completed-items) [Not implemented by this package]archive/items_many(#get-completed-items-with-a-list-of-parent-ids) [Not implemented by this package]Impact:
From the moment Todoist has made that change, all calls to the
ItemsService.GetCompletedAsyncmethod fail with the405 Method Not Allowed, regardless of theTodoist.Netversion used.Fix:
GetAsyncmethod was added to bothTodoistRestClientandTodoistClienerysimilar to thePostAsyncmethod.GetAsyncinstead ofPostAsync.