Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my experience, the biggest win is that it helps me as a developer to create clean interfaces. Whereas a homerolled RPC solution would encourage me to write controllers for different paths, taking arguments in various ways, when writing a REST interface I can create some kind of object:

  {
    index: function (req, res) { ... }
    create: function (req, res) { ... }
    retrieve: function (req, res) { ... }
    update: function (req, res) { ... }
    delete: function (req, res) { ... }
  }
And then map that whole resource under a certain path, "/resources".

Further, it is built on sound principles such as, you can't destroy or change anything using GET, you can issue requests other than POST any number of times and nothing will go wrong.

Other things like using HTTP headers to decide in which format the consumer wishes to consume the resource, HTTP status codes for error handling, and HATEOAS, gives me the feeling of working with the system instead of building cruft.

I argue that REST in fact makes it easier "to maintain and implement the web services". YMMV.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: