具体来说,我有评论,巢,我禁止删除评论与儿童。
所以当有人要求:
DELETE /comments/5
如果第5条评论有子评论,我不允许删除该评论。什么是合适的HTTP状态码?我用一个 405 401 适用于用户有权删除注释(例如,如果用户拥有注释)的情况,如果该注释不是针对孩子的。
405
401
送去怎么样 409 . 翻译成 The request could not be completed due to a conflict with the current state of the resource.
409
The request could not be completed due to a conflict with the current state of the resource.