Is a response-body allowed for a HTTP-DELETE-request?

前端 未结 2 1777
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 06:59

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.

2条回答
  •  野的像风
    2021-01-31 07:30

    It is explicitly mentioned here in the RFC

    The short answer is:

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

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

    204 says explicitly that you do not include a response body

提交回复
热议问题