How to make a DELETE request using curl

For more information about curl, checkout the “What is curl” article. This article will discuss how to interact with an API using DELETE requests through curl.

Make a simple DELETE request

The basic syntax for sending a DELETE request using curl is:

curl -X DELETE

NOTE: The -X flag is a shorthand for --request.

DELETE request example

curl -X DELETE \

In the example above, a DELETE request is sent to the JSONPlaceholder API to delete a post with an id of 1.