Yes, that's great. Imagine another case where the system provides URIs /myresources/latest
. When there are no resources, this can return 404, but when starting POSTing resources, both the canonical URI and the latest
URI will return 200 OK. There are many benefits to this approach.
However, keep caching when developing such resources. For example, if you send POST to the /myresources/
collection, you will invalidate this collection in any cache. However, you will not invalidate the /transactions/
collection, and the two indexes may go out of sync. In any case, they may not be synchronized throughout the system, depending on the cache schedule between several clients and the server of origin, but often clients get the opportunity to expect this action to be synchronous from a distance, and caching can upset this in such cases.
source share