-
Notifications
You must be signed in to change notification settings - Fork 22.4k
/
index.md
92 lines (73 loc) · 1.76 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
title: DELETE
slug: Web/HTTP/Methods/DELETE
page-type: http-method
browser-compat: http.methods.DELETE
---
{{HTTPSidebar}}
The **HTTP `DELETE` request method** deletes the specified
resource.
<table class="properties">
<tbody>
<tr>
<th scope="row">Request has body</th>
<td>May</td>
</tr>
<tr>
<th scope="row">Successful response has body</th>
<td>May</td>
</tr>
<tr>
<th scope="row">{{Glossary("Safe/HTTP", "Safe")}}</th>
<td>No</td>
</tr>
<tr>
<th scope="row">{{Glossary("Idempotent")}}</th>
<td>Yes</td>
</tr>
<tr>
<th scope="row">{{Glossary("Cacheable")}}</th>
<td>No</td>
</tr>
<tr>
<th scope="row">
Allowed in <a href="/en-US/docs/Learn/Forms">HTML forms</a>
</th>
<td>No</td>
</tr>
</tbody>
</table>
## Syntax
```http
DELETE /file.html HTTP/1.1
```
## Example
### Request
```http
DELETE /file.html HTTP/1.1
Host: example.com
```
### Responses
If a `DELETE` method is successfully applied, there are several response
status codes possible:
- A {{HTTPStatus("202")}} (`Accepted`) status code if the action will
likely succeed but has not yet been enacted.
- A {{HTTPStatus("204")}} (`No Content`) status code if the action has been
enacted and no further information is to be supplied.
- A {{HTTPStatus("200")}} (`OK`) status code if the action has been enacted
and the response message includes a representation describing the status.
```http
HTTP/1.1 200 OK
Date: Wed, 21 Oct 2015 07:28:00 GMT
<html>
<body>
<h1>File deleted.</h1>
</body>
</html>
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- HTTP status: {{HTTPStatus("200")}}, {{HTTPStatus("202")}}, {{HTTPStatus("204")}}