|
|
|
|
|
by hlandau
2580 days ago
|
|
The whole point of my article was that constraining things to a small, limited set of verbs is actually a bad idea. Theoretically you can just make up your own verbs for HTTP and use those. In practice people stick to the common ones because they're well supported. This leads to people massaging a problem domain into the straightjacket of GET/PUT/POST/PATCH/DELETE, regardless of how well it fundamentally fits that set of verbs. (I'm also convinced nobody actually knows what "REST" means, but that's another rant for another time.) |
|
The other thing a common set of verbs gets you is generic endpoints and, even more interesting, generic intermediaries.
My approach is to let resource-y things be resource-y, and let verb-y things be verb-y. After all, language has nouns and adjectives and verbs, maybe there is a good reason for this diversity?
So
(Although I am highly skeptical of IoT, so somewhat wary of such an example).If you wanted to model this in a more resource-y way, you could doL
That would also get you the ability to read the status of the doorbell.> I'm also convinced nobody actually knows what "REST" means
Considering REST is the basis of the WWW, the largest and arguably most successful information system of all time, I would say (a) most people understand it "well enough" to work with it and (b) if we don't understand it, it behooves us to make an effort to do so.
Because it's not like there haven't been other attempts to build something like the WWW, they just failed miserably.