A Sermon from the Church of RESTafarianism
September 14th, 2012
Brothers and Sisters,
I’ve come here today to preach the word of the mighty RESTa as revealed to us by the Great Profit Fielding, blessed be his dissertation.
What I have to tell you will not please or delight you. On the contrary, I fear that I my words will bring sadness to your hearts and boil to your blood. Nonetheless, I beseech you to hear me and hear me good: our beloved RESTa is under attack from those who proclaim themselves to be believers.
Yes, my fellow RESTafarians, there are many around you who claim to live the vision, but a precious few do. They proclaim allegiance with our cause, but they live lies. Their words speak the truth of RESTa, but their actions desecrate it.
How, you may ask, are these heathens tarnishing the perfection of RESTa? Let me count the ways.
There are those who choose not to honor the Four Forces of RESTa. Instead, they mutilate the sacred sanctity of the gentle GET by forcing it into unnatural acts. Oh how I weep every time my beloved GET is forced to update. Oh how my soul aches every time I see the honorable DELETE go unused, swept aside and forgotten.
There are those who cavalierly ignore proper status codes in their retorts. My friends, let me ask you this question: is it too much to ask to send back a 409 in case of conflict or a 201 if a resource was created? Of course not. But no, these miscreants choose to use the dreaded 200 for every single response, even errors. How do they live with themselves?
And then there are those who commit the most egregious sin of all: hating HATEOAS. Brothers and sisters, I submit to you that the very life force of our beloved RESTa stems from its simple, yet beautiful premise: ask and ye shall receive… the next question to ask. Yet it is this wonderfully named tenet that the heathens choose to ignore most of all.
They violate HATEOAS each time they stamp their hedonistic interfaces with versions, forever dooming them to exist. The violate HATEOAS each time they choose unnatural tongues of the curly braced and the sharply bracketed. Oh yes my friends, do not get seduced by the ubiquity of JSON or its wordy cousin XML. Always remember that these tongues lack the facilities to convey the loving message of HATEOAS and must therefore be shunned.
My fellow RESTafarians, as I humbly submit to you these and many other injustices being perpetrated against RESTa on a daily basis, I must ask you now: what shall be done about them? After all, is it not our sacred duty to defend the Founding Texts? Can we really allow ourselves to sit idly by as the infidels pick and choose which parts to implement and which to ignore, as if RESTa was some kind of an a la carte menu?
In the words of the mighty RESTa, I compel you to DELETE your turning a blind eye to this injustice, GET my indignation, and PUT an unambiguous rejection of this depravity. And I pray that all I get back from you is a 201.
Amen.
You may also like:
Did you love / hate / were unmoved by this post?
Then show your support / disgust / indifference by following me on
Twitter!
This post got 6 comments so far. Care to add yours?
Amen Brother….Seek the Beauty in Simplicity….
417
I’m confused. While I understand that JSON and XML don’t have the capacity for REST (I have made extensive attempts and found them lacking), I don’t see what we should use instead.
HTML is an easy response, but it doesn’t support enough of the request methods. Moreover, it is difficult to use in a non-browser context where such a limitation is greatly mitigated. Using JavaScript to work around these difficulties sometimes is not the best, and middle-ware to transform requests into the proper method is more code to maintain, often in an abstraction layer.
I implore you to enlighten us.
Hi Artanis,
Well, to be compliant with HATEOAS, you have to be able to respond to a request with links to further resources. Neither JSON nor XML support that natively (though I suppose you could argue that XML + XLink do), whereas HTML does. Also, I’m not sure what you mean by HTML “doesn’t support enough of the request methods”.
HTML supports GET and POST. Any other method is sent as POST.
Hello, HTTP is the protocol (supporting GET, POST, PUT, DELETE). HTML is the markup language.
The helpful mnemonic for this is the ‘P’ stands for protocol while the ‘L’ stands for language.
[…] geek humor and other drivel […]