REST URIs and operations on an object that can be commented on, tagged, rated, etc

后端 未结 7 2028
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-06 08:22

I\'m doing research into a web API for my company, and it\'s starting to look like we might implement a RESTful one. I\'ve read a couple of books about this now (O\'Reilly\'s \"

7条回答
  •  借酒劲吻你
    2021-02-06 08:51

    This is not REST.

    A REST API must not define fixed resource names or hierarchies (an obvious coupling of client and server). Servers must have the freedom to control their own namespace. Instead, allow servers to instruct clients on how to construct appropriate URIs, such as is done in HTML forms and URI templates, by defining those instructions within media types and link relations. [Failure here implies that clients are assuming a resource structure due to out-of band information, such as a domain-specific standard, which is the data-oriented equivalent to RPC's functional coupling].

    http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven

提交回复
热议问题