4 ms·
That is a way to make non-REST API be more like REST. REST APIs must be self-describing from the start. Those kinds of responses should be sent for GET request
by pornel 15y ago
That is a way to make non-REST API be more like REST.
REST APIs must be self-describing from the start. Those kinds of responses should be sent for GET requests!
This is a must-read clarification from Roy, as most "REST" APIs are less RESTful than HTML pages built on top of them:
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...
- eloisius 15y agoSure. I'm not so interested in arguing about the nuances of what REST really is. Even Leonard Richardson gracefully sidesteps the arguments by talking about resource oriented architecture. The part the interestes me most is documenting the parameters so that web services can better understand how to work with each other, instead of someone like me pouring over the docs and writing mundane glue code to tie Twitter search features into a service.
- detst 15y agoCheck out Google's API Discovery Service[1] and a video from the 2010 I/O Conference[2]. It may not be the best basis for developing a RESTful standard but there's some good stuff there. I especially like how they demonstrate building an API in that video. I'd like to see some open source projects built around this concept (instead we keep seeing similar services that aren't open, often incomplete and unusable). [1] https://developers.google.com/discovery/ https://developers.google.com/discovery/ [2] http://www.youtube.com/watch?v=nyu5ZxGUfgs http://www.youtube.com/watch?v=nyu5ZxGUfgs (~35:30 is where they actually demonstrate building an API)
- tbatterii 15y agoLike WSDL. except JSON instead of XML. :)
- tantalor 15y agoI think this bit is particularly relevant, > Any effort spent describing what methods to use on what URIs of interest should be entirely defined within the scope of the processing rules for a media type (and, in most cases, already defined by existing media types). What are the "processing rules" for JSON? Do they depend on the application? Do we have a standard? My first thought is something like this, { "resources": { "foo": { href: 'http://example.com/foo', method: 'get' }, "bar": { href: 'http://example.com/bar', method: 'post' }, "baz": { href: 'http://example.com/baz', method: 'put' }, } }
- justincormack 15y agoYes, to be useful for REST json really needs either a type for hyperlinks or a naming convention. Arguably then it is an extension of json and needs a new mime type...