4 ms·
On a related topic, I hear the best practice is to make use of HTTP methods like PUT and DELETE. Am I in a tiny minority that wishes we could use verbs in URIs,
by zaidf 9y ago
On a related topic, I hear the best practice is to make use of HTTP methods like PUT and DELETE. Am I in a tiny minority that wishes we could use verbs in URIs, ie http://api.blah.com/student/32/delete http://api.blah.com/student/32/delete instead of relying on the DELETE http method to communicate that point?
- noisy_boy 9y agoWouldn't that place "delete" at the same level as, e.g., "courses" i.e. http://api.blah.com/student/32/courses http://api.blah.com/student/32/courses?
- jack9 9y agoHe's trying to articulate using arbitrary semantic uri schemes (that was just a simple example) rather than HTTP verbs. Ultimately, you have to document them in your APIs anyway and the caching reasoning (along with all the others I've heard), just haven't been useful in practice.
- tomstuart 9y agoYes, because request methods provide a uniform way of communicating meaningful information to HTTP infrastructure like caches. If a request uses the DELETE method then a cache in the middle can know something about the meaning of that request (e.g. it's idempotent) and change its behaviour accordingly. If that information lives only in the URI then there's no way for a cache to understand its significance.