56 points · by llambda · 14y ago · 46 comments
The reason that I bring this up, and have harped on this before, is that when most people design REST they are using HTTP + JSON. The problem is that JSON is not hypermedia. Hopefully it will not become hypermedia. As a result, the systems that are HTTP + JSON are not REST. They are RESTish, but not REST.
I think that the terms really have value. That is the purpose of language. If we go about calling things that use POST or Get or PUT + JSON hypermedia, we can start to misapply the thoughts of the thesis. If we don't stick to the terms, we can not hope to properly understand the thesis' context and its fundamental goal of synthesizing lessons learned by Roy in how to design a better Internet infrastructure.
Seriously, why is it so hard to develop using a method that is supposed to make building web services easier?
Please note that I'm not trolling: I have spent the past year and a half trying really hard to build RESTful web services, I see and have experienced the benefits of this approach, and I think I've been getting progressively better at it.
In this case, sending some representation as just JSON (application/json) clearly breaks the Uniform Interface constraint, particularly the HATEOAS principle: a client is supposed to only know the base URL and the mimetypes. If he gets 'application/json' as a reply, how is he supposed to know what to do with it? It may be a user profile, or a blog post, or a description of an UI, etc, there's no way to tell.
In defense of the grandparent post though, REST never specified a data or for that mater media format. It could be JSON or XML or even a binary format like a bitmap but a lot of people that talk about RESTfull services talk about JSON which is not a requirement of the original REST concept. REST was more about how a resource was accessed, not what that resource is.
Not really. The web is a RESTful system, but there's nothing specific to HTTP in REST. It's just an architectural style, it doesn't specify nothing in concrete.
To clarify, "application/json" is not REST, but "application/foaf+json" can very well be.
But I agree: it is an uninformative term for anything which merely establishes a connection and sends/receives data as opposed to specifically delivering content.
REST is just fine as it is. It is a well-understood term for what it does. Why reinvent the wheel and stick a new label on it every five minutes?
"The World Wide Web is driven by hypermedia: the ability of a document to describe its possible states, and its relationship to other documents. Hypermedia is not just a way of making websites that average people can use; it’s a new style for distributed computing, powerful and flexible."
(...) Representational State Transfer (REST) architectural style for distributed
hypermedia systems (...)
Roy Fielding also talks about Hypertext[2], which means essentially the same (hypermedia being an expansion of the concept of hypertext).[1]: http://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch...
[2]: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte...
when you cannot think of any other way to improve something, suggest a name change!
This article from Roy Fielding is much better: http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hyperte... The comments are also helpful.