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

> Fielding's own examples from his blog, how'd you turn a lamp on and off via REST? Would you be like `POST /lamp`? No. It's unclear WTF is happening.

No, of course you'd be like `PATCH {"light": "off"} /lamp`!

Kidding of course but it's true that REST purity does not make for intuitive APIs in complex real-world problem domains.



In HTML, you could have a FORM with the URL of /lamp/switch that you PUT.


PUT is not a valid method from an HTML form. Only GET or POST are permitted.


This kind of reveals a little secret of many of the REST gurus. They have no clue what they're talking about.


So you're putting a switch. Great API design.




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

Search: