4 ms·
DELETE a card from the deck. Return the card(s) drawn in the response body. Have a separate resource for the top of the deck: DELETE /api/<deck-id>/top?count=2
by jalfresi 11y ago
DELETE a card from the deck. Return the card(s) drawn in the response body. Have a separate resource for the top of the deck:
DELETE /api/<deck-id>/top?count=2
------
200 Ok
8♣
10♥
- hartror 11y agoDELETE is idempotent to quote a Stack Overflow answer on the subject: > Idempotence refers to the state of the system after the request has completed > ... > The key bit there is the side-effects of N > 0 identical requests is the same as for a single request. http://stackoverflow.com/questions/4088350/is-rest-delete-really-idempotent http://stackoverflow.com/questions/4088350/is-rest-delete-re...
- jalfresi 11y agoThe example I gave is idempotent. Calling it n >0 times would result in the same side effects.