4 ms·
You don't need PUT nor DELETE. It is OK to use POST[1]. Most people don't understand REST. It is not a standard, it is not a set of practices. It is an archite
by alganet 10y ago
You don't need PUT nor DELETE. It is OK to use POST[1].
Most people don't understand REST. It is not a standard, it is not a set of practices. It is an architectural style and the web is built on it.
You can choose to follow the style (which is so much more than naming methods and URIs) or fight it. The dissertation is pretty clear about it[2], but most people ignore it because there are no code samples.
[1]: http://roy.gbiv.com/untangled/2009/it-is-okay-to-use-post http://roy.gbiv.com/untangled/2009/it-is-okay-to-use-post (REST creator talking about the PUT misconception)
[2]: http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm (Full REST dissertation)
- coldtea 10y ago>You can choose to follow the style (which is so much more than naming methods and URIs) or fight it. And most people chose to ignore it -- and implement RESTful (mostly unrelated to REST as described by Roy) APIs, and no much harm has befallen them.
- alganet 10y agoIgnoring the dissertation is OK. It was designed for people to understand how the web was designed, not as an implementation guide. Ignoring REST is impossible, the web is built on it. - The uniform interface is in every URI (if you use them, you use REST). - The code-on-demand constraint is everywhere (if you use JavaScript, you're using REST). - Hypermedia is everywhere (if you have links on your web page, you're using REST). - The client-server constraint I don't even have to bother explaining (although WebRTC might bring P2P back in the game). - The layering is everywhere (if you do haproxy, varnish, squid or similar, your using REST). The _RESTful API_ thing is just a myth. People needed a name to discourage tunneling RPCs over HTTP, so they invented these loosely defined terms to push the idea. It should be called HTTPful, because it tells more about avoiding re-implementing HTTP features than it tells about the REST style.
- deleted 10y ago[deleted]
- amorphid 10y agoWhen given the choice, I only use PUT. Personally, I like idempotent requests.