The reason behind the half-REST design pattern
stereolambda.wordpress.com
The reason behind the half-REST design pattern
1–10 of 19 posts
Re: The reason behind the half-REST design pattern
#2Re: The reason behind the half-REST design pattern
#3Re: The reason behind the half-REST design pattern
#4Re: The reason behind the half-REST design pattern
#5Re: The reason behind the half-REST design pattern
#62) Read the "Content-Type" header of the request to find out how to parse it. Whats so hard about that?
REST is where Javascript was 8 years ago, everybody things its horrible because very few people actually understand how the whole thing works, and all the implications of that.
Re: The reason behind the half-REST design pattern
#7I think Ruby on Rails default scaffolding actions and routing have influenced the popularity of the half-REST design.
Re: The reason behind the half-REST design pattern
#8I think Ruby on Rails default scaffolding actions and routing have influenced the popularity of the half-REST design.
I myself have been guilty of this. At the end of the day, supporting PUT at expense to ease of use by the API consumer (and effort expended to support their toolchains and SDKs, most of which need extra twiddling to do PUT and DELETE) is just not preferable to getting something working... REST philosophies be damned.
Re: The reason behind the half-REST design pattern
#9If someone more schooled in web design wouldn't mind answering, what problems arise of by using the GET add-contact api as described in the post? What is the benefit of using xml in the body of a PUT or POST verb vs the headers?
...the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval.
Why? GET should mean simply getting the page. Not doing so runs the risk of:
- Bookmarks breaking (what if someone bookmarks the add-contact link?)
- Google deleting everything because it followed the links (there is an example of this on The Daily WTF)
- Easy cross-site request forgery attacks (I post an "image" with the url that deletes your address book on some message board. You are still logged in with a cookie, so it goes ahead)
Even if the site in question is doing something to prevent the above, why reinvent the wheel and not just use POST (or a more RESTful method)?
As for XML, lots of people hate it, and there is no real requirement to use it (unless your users want it, of course). JSON or even form data can work.
As for headers, there might be a risk of a stupid proxy server mangling them, but nothing should mess with the body of the request. And it's just more conventional to describe the request as the request body, and have headers act as the meta-information about it. (I'm assuming you meant HTTP headers)
Re: The reason behind the half-REST design pattern
#10I think Ruby on Rails default scaffolding actions and routing have influenced the popularity of the half-REST design.
Rails default scaffolding and routing absolutely do use the full REST design, supporting both PUT and DELETE as well as inbound XML and JSON payloads