7

In an API, what HTTP METHOD should be used for a cancel operation.

I imagine this wouldn't be a DELETE request, because the resource is not being disposed of. In which case, should it be a POST or a PUT ? Here is some documentation, but I still am not clear on the distinction from this: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

David542
  • 104,438
  • 178
  • 489
  • 842

1 Answers1

11

This isn't a DELETE. Cancelling an operation is a state change and a state change means an update.

I would personally use a PUT because you normally know the URI of the resource you are updating.

Also see this post for more details: PUT vs POST in REST.

Community
  • 1
  • 1
Bogdan
  • 23,890
  • 3
  • 69
  • 61