On Wed, Jul 1, 2009 at 9:24 AM, Mike Kelly <mike@...> wrote:
Peter Keane wrote:Do you mean like this?
3. Â add a link to a cart resource pointing to the product
GET /cart
"cart" : {... , "products": [], .... }
adding products:
PUT /cart
"cart": {..., "products": [ "/products/143", "/products/534" ], .... }
removing product 534:
PUT /cart
"cart": {..., "products": [ "/products/143" ], .... }
Mike-
Yes, that's basically what I was proposing. (I was thinking specifically in terms of Atom, but the GET/EDIT/PUT pattern is exactly the approach I was suggesting). That exact operation might well be implemented by drag-and-drop (for example) in the UI, but the underlying API operation would be much as you describe.
--peter