RESTful Service Theory: Difference between revisions

m
Changed link
m (Adding link)
m (Changed link)
Line 32: Line 32:
*[https://www.w3schools.com/tags/att_a_href.asp hypertext references] (HREFs) to provide navigable links between different resources
*[https://www.w3schools.com/tags/att_a_href.asp hypertext references] (HREFs) to provide navigable links between different resources


The last of these is somewhat controversial: REST purists (sometimes referred to as [https://mikeschinkel.com/2006/whatisarestafarian/ "RESTafarians"]), including [https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven Fielding himself], maintain that to be properly RESTful, an API must exhibit the property of [https://en.wikipedia.org/wiki/HATEOAS HATEOAS] ("'''H'''ypermedia '''A'''s '''T'''he '''E'''ngine '''O'''f '''A'''pplication '''S'''tate"). By this they mean that an API should be "entered" by a client via a single known URL, with all other resources, and the operations which can be performed on them, being "discoverable" through HREF links and other information returned by the server. In his dissertation Fielding says: "''REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, '''hypermedia as the engine of application state'''''"; the last of these has become something an article of faith among some in the community, with interfaces (APIs) which do not conform to such a constraint being dismissed as "[https://www.jsonrpc.org/specification JSON-RPC]". In practice, you are free to make your own design choices: there is nothing wrong with JSON-RPC if that fits your requirements.
The last of these is somewhat controversial: REST purists (sometimes referred to as [http://www.ben-morris.com/the-restafarian-flame-wars-common-points-of-disagreement-over-rest-api-design/ "RESTafarians"]), including [https://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven Fielding himself], maintain that to be properly RESTful, an API must exhibit the property of [https://en.wikipedia.org/wiki/HATEOAS HATEOAS] ("'''H'''ypermedia '''A'''s '''T'''he '''E'''ngine '''O'''f '''A'''pplication '''S'''tate"). By this they mean that an API should be "entered" by a client via a single known URL, with all other resources, and the operations which can be performed on them, being "discoverable" through HREF links and other information returned by the server. In his dissertation Fielding says: "''REST is defined by four interface constraints: identification of resources; manipulation of resources through representations; self-descriptive messages; and, '''hypermedia as the engine of application state'''''"; the last of these has become something an article of faith among some in the community, with interfaces (APIs) which do not conform to such a constraint being dismissed as "[https://www.jsonrpc.org/specification JSON-RPC]". In practice, you are free to make your own design choices: there is nothing wrong with JSON-RPC if that fits your requirements.


=Resources=
=Resources=