by beaumartinez · 13y ago · 0 comments
A RESTful API is more than just using GET to access resources.
It would be better if people just said "HTTP" when they mean "REST," but that's a long shot.
[1] http://en.wikipedia.org/wiki/Resource-oriented_architecture
Exampe: POST {"state": "unlocked} to http://doors/front-left/lock
I realize I don't understand this, so your comment, and any further points you have, are sincerely appreciated.
You would GET the lock to see if it's locked, GET the battery to read its charging state.
You could PUT to the battery (or to some more abstract, finer-grained resources) to set the charge mode and turn charging on and off. The HVAC and thermostat would work the same way.
The only tricky stuff is "flash lights" and "honk horn"; they're inherently commands, so you might as well implement them in the RPC style that Tesla has used. They can't benefit from anything REST has to offer anyways.