[Important] Switch to using GET
instead of POST
for GET
-only endpoints
#55
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
GET
andPOST
. So, according to this article, some endpoints will only acceptGET
and 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 theircurl
examples and found that the following endpoints acceptGET
by 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.GetCompletedAsync
method fail with the405 Method Not Allowed
, regardless of theTodoist.Net
version used.Fix:
GetAsync
method was added to bothTodoistRestClient
andTodoistClienery
similar to thePostAsync
method.GetAsync
instead ofPostAsync
.