7 ms·
Just so that I'm clear on this, are you just criticizing that all requests go to /word.json? IOW, would the following be RESTful? GET /entries/{word} # Ret
by coolgeek 15y ago
Just so that I'm clear on this, are you just criticizing that all requests go to /word.json?
IOW, would the following be RESTful?
GET /entries/{word} # Return entries for a word
GET /wordForms/{word} # Rturn other forms for a word
POST /wordForms/{word} # Adds a relationship map for a word
- arethuza 15y agoI think the point is that if you are documenting the structure of URIs you are focusing on the wrong thing - a RESTful interface documentation should mostly be about the hypermedia (HTML, XML, JSON,...) that the URIs are embedded in - a particular server should really have the freedom to construct the URIs in any way it wants and still have clients that understand the API work. See: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...
- smhinsey 15y agoI think when done right (a subjective measurement, to be sure) the only URI you care about for a RESTful API is the root, because the API's resources are defined, along with how they can be manipulated, in the root response or can be transitioned to from there in some way that is defined there.
- jcromartie 15y agoYes, that's the key. If the media types are documented (like how browsers and developers understand HTML forms) then you don't need to document every single corner of the API. You can offer a good definition of the media types, and let the resources and links do the rest.