是否允许HTTP-DELETE请求的响应体? [英] Is a response-body allowed for a HTTP-DELETE-request?

查看:598
本文介绍了是否允许HTTP-DELETE请求的响应体?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我假设响应代码200总是允许响应体,但我找不到任何明确提及DELETE请求的响应体。

I assume the response code 200 always allows for a response-body, but I can't find any explicit mention of response-bodies for DELETE-requests.

推荐答案

这里明确提到 RFC

简短的回答是:

如果您返回 200 应该包含一个回复正文,其中有一个实体描述已删​​除的商品/资源。

You should include a response body with an entity describing the deleted item/resource if you return 200.

202 类似于异步请求/响应返回状态。

202 is something like an asynchronous request/response return status.

204 明确表示您未包含回复正文

204 says explicitly that you do not include a response body

这篇关于是否允许HTTP-DELETE请求的响应体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆