HTTP DELETE Request Method

The HTTP DELETE method is used to delete a resource from the server. Unlike GET and HEAD requests, the DELETE requests may change the server state.

Sending a message body on a DELETE request might cause some servers to reject the request.
But you still can send data to the server using URL parameters. This is usually an ID of the resource you want to delete.

The DELETE method is defined to be idempotent, which means that sending the same HTTP DELETE request multiple times will have the same effect on the server and will not additionally affect the state or cause additional side effects.

The following example demonstrates sending a DELETE request to the server:

DELETE Request Example Live Request
DELETE /echo/delete/json HTTP/1.1
Authorization: Bearer mt0dgHmLJMVQhvjpNXDyA83vA_PxH23Y
Accept: application/json
Content-Type: application/json
Content-Length: 19
Host: reqbin.com

And the server response:

Server Response
HTTP/1.1 200 OK
Content-Length: 19
Content-Type: application/json

{"success":"true"}

HTTP DELETE Response Codes

A successful response MUST be 200 (OK) if the server response includes a message body, 202 (Accepted) if the DELETE action has not yet been performed, or 204 (No content) if the DELETE action has been completed but the response does not have a message body.

HTTP DELETE Method Specification

Safe No
Idempotent Yes
Cacheable No
Can have a body Yes

See also

Last updated: Viewed: 12384 times