MDN wants to learn about developers like you: https://qsurvey.mozilla.com/s3/MDN-dev-survey

HTTP DELETE 请求方法用于删除指定的资源。

Request has body No
Successful response has body No
Safe No
Idempotent Yes
Cacheable No
Allowed in HTML forms No

语法

DELETE /file.html HTTP/1.1 

示例

请求

DELETE /file.html HTTP/1.1

响应

如果 DELETE 方法成功执行,那么可能会有以下几种状态码:

  • 状态码  202 (Accepted) 表示请求的操作可能会成功执行,但是尚未开始执行。
  • 状态码 204 (No Content) 表示操作已执行,但是无进一步的相关信息。
  • 状态码  200 (OK) 表示操作已执行,并且响应中提供了相关状态的描述信息。
HTTP/1.1 200 OK 
Date: Wed, 21 Oct 2015 07:28:00 GMT

<html>
  <body>
    <h1>File deleted.</h1> 
  </body>
</html>

规范

Specification Title
RFC 7231, section 4.3.5: DELETE

Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Browser compatibility

FeatureChromeFirefoxEdgeInternet ExplorerOperaSafari
Basic Support(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)
FeatureAndroidChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic Support(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)(Yes)

相关内容

文档标签和贡献者

 此页面的贡献者: Ende93, WayneCui, xgqfrms-GitHub
 最后编辑者: Ende93,