Re: the meaning of stateless
Mark Baker <[email protected]> Fri, 3 May 2013 10:54:50 -0400
| Newsgroups | gmane.comp.web.services.rest |
|---|---|
| Message-ID | <CALcoZio0OfqAMs_y6Y9s_zkQ_2trOb4Jm23yUQ4662F9re-x2A@mail.gmail.com> |
On Fri, May 3, 2013 at 3:00 AM, Mike Kelly <[email protected]> wrote: > Statelessness is about _shared state_ held between client and server. Violating that constraint means creating an interaction that, in order to determine its outcome, requires additional shared context _not visible in the request_ and established by some previous interaction. > > (It has nothing to do with server persisted shopping carts.) > > As long as you don't create an interaction described by the above you aren't violating the stateless constraint. But using a server-side shopping cart typically *does* violate that constraint... not while you're shopping and adding/removing stuff to/from the cart, but when you checkout by sending a message which means "Purchase what's in that cart", when the intended meaning is "Purchase size 9 Nike Air Max for $199".