19680Re: [rest-discuss] RESTful Toggle
- Jul 9, 2014hello robby.
On 2014-07-09, 17:47 , 'Simpson, Robby (GE Energy Management)'
robby.simpson@... [rest-discuss] wrote:
>> it sounds like the scenario we were talking about, that all you want isthe problem is not that POST can mean anything (it can), but people
>> to tell the resource to "reverse its state". in this case, i'd POST a
>> body that represents this request, in whatever serialization you happen
>> to prefer. the resource toggles. everybody's happy.
> OK. Still seems like a bit of a departure from typical RESTful interfaces
> I've seen and has the potential to be a catch-all tunnel for RPC-style
> /command, where one could POST all sorts of commands like "toggle."
POSTing things to a "do stuff" resource, which then isn't
resource-oriented anymore. your RPC sensor shouldn't go off because of
people POSTing things to resources (that's fine), but because of people
POSTing things to something other than resources (the "API end point",
>> but i am confused because you wrote earlier that you were concernedthen how would a race condition enter the picture? just because of the
>> about race conditions. which seems to imply that instead of just
>> toggling, you're also assuming that you're "toggling *from* some state".
>> but that wouldn't be the "blind toggle" we discussed. could you clarify
>> a bit how exactly the operation that you're trying to design is defined?
> Apologies, a blind toggle is what is desired. As it currently works, in
> the current binary protocol, a button press on a toggle switch simply
> sends a "toggle" command.
timestamp when you last observed the resource's state? or something
else? to me, toggling always is kind of a game: if somebody toggled
ahead of you, you'll do something other than you wanted to, but that's
how it is and you'll have to deal with it after toggling and finding out
that you switched the damn thing back on again...
erik wilde | mailto:dret@... - tel:+1-510-2061079 |
| UC Berkeley - School of Information (ISchool) |
| http://dret.net/netdret http://twitter.com/dret |
- << Previous post in topic Next post in topic >>