Not by people who know what they're talking about.
> This makes so much more sense because then you can use ?command= and have any command you want and not have people confused about what it means.
That's textbook RPC. It's a pattern that works well for many things, but it's definitely not REST.
One of his goals was that a document would be able to provide links to another document in a natural, intuitive way. It is ment to be so intuitive in fact that the interchange of the document doesn't need a schema or WSDL like system. HTML has this ability. JSON however doesn't.
If one wants to nest links in JSON, one has to tell the client how those links will appear. On has to define the structure beyond merely syntaxical correctness. This is where REST falls down, IMHO.
So I recommend pursuing pieces of REST. But a full HATEOS concept seems to meaningfully limit on to symantec HTML.
No he's not, he's baked hyperlinks into his thesis as the base of REST, that has nothing to do with HTML.
> One of his goals was that a document would be able to provide links to another document in a natural, intuitive way.
No. His goal is merely that documents be hyperlinked, how is the application's domain.
> It is ment to be so intuitive in fact that the interchange of the document doesn't need a schema or WSDL like system.
I don't know where you got that one, but it's definitely not part of Fielding's thesis or his comments on the subject since. It's in fact exactly the opposite, the one thing Fielding notes must be documented in details in a RESTful service is media types, aka the documents returned by the service. That's where hyperlink semantics are added.
> JSON however doesn't.
Neither does SGML or XML, that's not an issue.
> If one wants to nest links in JSON, one has to tell the client how those links will appear.
Just as one has done with HTML.
> On has to define the structure beyond merely syntaxical correctness.
Just as with HTML.
> This is where REST falls down, IMHO.
That's complete and utter nonsense.
The only difference between HTML and JSON is that HTML is already an application of a meta-document type (well used to be, of SGML, it's drifted further but conceptually it still is) whereas JSON, much like XML, is a meta-document type from which users build applications (what do you think application/xhtml+xml is?).
You sound like you want some magical silver-bullet through which you don't have to document anything and things suddenly understand each others based on fairy dust. Reality does not work that way.
Then use HTML. Or some other representation with known link semantics.
I don't see how failures or shortcomings of JSON indicate a problem with REST. They are orthogonal; JSON has nothing to do with REST, it's just a serialization format some people like.
The long and the short of the document was that a REST client must be able to navigate the entire API when given just a single endpoint URL, much like you can navigate an entire website just by entering the homepage URL into your browser, but without the dependance on HTML.
The leap the document made, and what virmundi seems to be referring to, is that a REST client that speaks, say, JSON is not enough to traverse any random service, as everyone will provide a completely different JSON representation of their data. When you start hardcoding site-specific keys in which to find the action descriptions, you lose all of the flexibility the author claimed REST would provide in the first place.
I've downloaded the original thesis. I'll look there to see what's mentioned about the hypermedia linking process.
Or define link semantics in JSON, the one documentation a restful service should have is that of media types (the documents returned) anyway, the only URL which should appear in the documentation is the root of the service.
Whining that JSON has no link semantics is nonsensical, SGML does not have any either, HTML added those when it was first created as an application of SGML, just as text/xhtml+xml is an application of XML defining links, "XML" as a meta-type does not know about links either.
PUT specifies the resource to be update, whilst POST does not do so. This means that you must (according to RFC 2616) use POST if you want to create a new resource and PUT if you want to change an existing resource or create one that you know "how to name". This disctinction is sometimes necessary, or at least useful (ex: idempotence of PUT).
I don't understand how any even half-competent developer would be unable to understand this difference and act accordingly.
My point is not that the ascribed meaning of POST and PUT is bad, I think the concepts behind both these functions are great, but what if you want to make a different or more complicated function? It makes sense to me to invent your own rather than be limited to what HTTP gives you.
This isn't complicated stuff.
calling "PUT a=b&c=d" three times should be identical to calling it once. So any time you let the system generate an ID for the resource you should use POST.
PUT works in creation when you know the id beforehand.
I have not worked with amazon s3 but I hear they handle this well. You PUT a file to a url containing the file name. The first PUT creates the file on their end, any future PUT updates that file.
This shouldn't matter much, but it does.
[0]http://goo.gl/UFSdZ (links to Chrome extension store)
I had to build an API that lived inside a system with entirely too many authentication/cookie checks and using curl was becoming too awkward for testing, this saved me a lot of time.
If I could break it down to the simplest form:
GET requests can be cached, any other method should be processed.
If you look at the twitter API (https://dev.twitter.com/docs/api) (commonly held up as exemplary REST) you will see exactly 2 methods, GET and POST. GET means no state change other than logging, POST implies state change. This makes so much more sense because then you can use ?command= and have any command you want and not have people confused about what it means.