Loading ...
Sorry, an error occurred while loading the content.

19671Re: [rest-discuss] RESTful Toggle

Expand Messages
  • Erik Wilde
    Jul 9, 2014
    • 0 Attachment
      hello dong.

      On 2014-07-09, 17:14 , Simpson, Robby (GE Energy Management) wrote:
      > Yes, in my application I'm actually more interested in a "blind" toggle like the pull handle of a slot machine. (Perhaps that would be a better example going forward)

      like nick, i'd be curious about the use case as well, but assuming that
      you have one and you really want that blind toggle:

      > Regarding the POST, I'm still a bit confused as to how this would be constructed. In my applications, I've tended to use the POST method on "collection" resources to create a new resource that is a member of the collection. It seems to me if one had a resource /pullHandle and simply used POST with an empty body, that we are really heading down the RPC route rather than being RESTful. This also overloads the semantics of POST ("POST as create a member" and "POST as ?activate?"). Am I just overthinking here?

      POST is not create, this is a common misconception (RFC 7231 now does a
      much better job at explaining POST than RFC 2616 did). it's REST's
      catch-all, so you can happily POST a "toggle" request to the resource
      itself, and that will toggle the resource's state.



      erik wilde | mailto:dret@... - tel:+1-510-2061079 |
      | UC Berkeley - School of Information (ISchool) |
      | http://dret.net/netdret http://twitter.com/dret |
    • Show all 36 messages in this topic