DELETEActive
DELETE removes the specified resource. It is idempotent – deleting a resource twice is equivalent to deleting it once (the second call returns 404 but the end state is the same). A successful DELETE returns 204 No Content with no body.
Properties
| Safe | No | Safe methods don't change server state. They are read-only. |
| Idempotent | Yes | Idempotent methods produce the same result if called once or multiple times. |
| Cacheable | No | Cacheable responses may be stored and reused for equivalent requests. |
| Request Body | No | Whether a request body is allowed / expected. |
| Response Body | No | Whether a response body is expected. |
Description
The DELETE method deletes the specified resource. DELETE is idempotent – if you delete a resource that was already deleted, the result (the resource not existing) is the same.
Examples
Delete a user
http
DELETE /api/users/42 HTTP/1.1
Host: api.example.com
Authorization: Bearer <token>204 Response
http
HTTP/1.1 204 No Content