News for hackers. Stuff that matters.
Re:PUT or POST: The REST of the Story by lucisferre on Thursday January 26, 2012 @12:27PM (#3515005)
Are there any examples of REST API implementations that are actually true to the original concepts or is everything kind of a "Web API" compromise? As a follow up, does, and should, anyone actually care really?

Is REST really just a pipe-dream in practice?

Re:PUT or POST: The REST of the Story by ExpiredLink on Thursday January 26, 2012 @12:39PM (#3515060)
Comments like 'you are doing it wrong', and 'you haven't understood REST' are posted to most REST articles I have seen. Obviously nobody ever has done REST right.
Re:PUT or POST: The REST of the Story by pyre on Thursday January 26, 2012 @04:28PM (#3516080)
Or the people that understand REST don't write about it.
Re:PUT or POST: The REST of the Story by Ixiaus on Thursday January 26, 2012 @05:24PM (#3516257)
I've found a painful lack of examples too. There's a lot of written material but few concrete examples from what I've found...
Re:PUT or POST: The REST of the Story by jmitcheson on Friday January 27, 2012 @05:14AM (#3517795)
Just wait until you see my Lean startup's REST based MVP that we produced with Agile.

(Downvotes, ho!)

Re:PUT or POST: The REST of the Story by Ixiaus on Thursday January 26, 2012 @05:22PM (#3516246)
I've been reading a lot of these articles and would like to think that I've implemented a RESTful API. I use GET for the get_all, get_one methods; PUT for create and PUT for replace/modify (as in replacing a field, not appending to it), HEAD for checking if certain resources exist, and DELETE for the obvious.

The framework I'm using assigns any visit a new session, but it's unused in the sense that the REST interaction doesn't require the session and also doesn't use it - authentication is handled using a the "Authorization: basic" header.

Re:PUT or POST: The REST of the Story by peregrine on Thursday January 26, 2012 @12:58PM (#3515139)
Well I've created what I believe to be, and what this article describes twice now for internal web-services[1]. Its really quite easy if you are disciplined and it really ends up being a very nice interface. The trick becomes if you want to eat your own dogfood with a website. Since forms can only post and get it makes it tricky without JS.

Otherwise I've been very happy and content with my 100%[1] restful webservices.

[1] According to this article, the one it linked to, and a medium skimming of the original dissertation.

Re:PUT or POST: The REST of the Story by aGHz on Thursday January 26, 2012 @01:10PM (#3515182)
Are you just HTTP-compliant (using the proper verbs and having Uniform Resource Locations point to actual resources) or are you truly 100% restful?
Re:PUT or POST: The REST of the Story by peregrine on Thursday January 26, 2012 @02:55PM (#3515686)
I suppose looking back I do have a concept of a session which is state. So no, but I organized my verbs and URL's to meet the specification and have the option to remove those sessions.

But I guess since I'm using a cookie-based sessions its less of an issue for state changes since the state stays mostly on the client.

Re:PUT or POST: The REST of the Story by mikaelgramont on Thursday January 26, 2012 @03:49PM (#3515924)
Agreed. Sessions and the limitations of forms are the biggest obstacles to 100% restful APIs used from web browsers.
Re:PUT or POST: The REST of the Story by NanoWar on Friday January 27, 2012 @04:49AM (#3517737)
You can however use XHR form submission[1] in the background (which is a good practice (better site responsiveness) after all) to use HTTP methods other than GET and POST.

[1] e.g. http://jquery.malsup.com/form/#json

Re:PUT or POST: The REST of the Story by bct on Thursday January 26, 2012 @04:48PM (#3516140)
Re:PUT or POST: The REST of the Story by lucisferre on Thursday January 26, 2012 @05:38PM (#3516293)
I probably should have specified "other than atom pub". It is so trivially REST since it simply describes publishing web pages using HTTP.

I'm more interested if anyone has managed to use REST for an API that has more business logic than simply publishing documents.

Re:PUT or POST: The REST of the Story by bct on Friday January 27, 2012 @03:29PM (#3519999)
I don't understand the distinction you're making between "trivially" and "non-trivially". Looking at pretty much any commercial CMS you can see that publishing documents can involve all kinds of business logic.
Re:PUT or POST: The REST of the Story by tef____ on Thursday January 26, 2012 @02:03PM (#3515438)
rest is how the web works.

if you used a browser to write that comment, I would say rest is working pretty well.

Re:PUT or POST: The REST of the Story by lucisferre on Thursday January 26, 2012 @05:42PM (#3516305)
From you're massively oversimplified statement I can only conclude you don't understand REST. HTTP != REST. REST is how the architects of HTTP generally expected things to work, but due to tunneling, and other approaches to API design it, generally speaking, most systems that operate over HTTP don't actually work that way.

In fact I'd be willing to bet this comment form isn't all that RESTful.