how.wtf

How to make a DELETE request using curl

· Thomas Taylor

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:

1curl -X DELETE https://example.com

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

DELETE request example

1curl -X DELETE \
2    https://jsonplaceholder.typicode.com/posts/1

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

#Linux  

Reply to this post by email ↪