This lesson walks you through submitting an HTTP DELETE method request using Postman. Similar to what the name implies, this method informs the server that you would like to delete the resource indicated in the URL endpoint.
Note: This is one of the more straightforward HTTP methods, but it operates with high stakes. Errors are not common, so be careful before hitting send. You may end up deleting something by accident.
How to Make a DELETE Request in Postman
-
Open a new tab in Postman.
-
Change the task ID in the URL below to the ID of the task you would like to delete and paste it into Postman.
http://demo.codingnomads.co:8080/tasks_api/tasks/{insert_ID}
-
Set the HTTP method to
DELETE. -
Hit the 'Send' button.
-
Wait for confirmation from the server that the resource was deleted. You should see a response similar to the one below.
Info: Send the request again and take a look at how the server responds the second time. Notice how the server is good at indicating what it didn't like about your request. This is a characteristic of a good API. Try to design your APIs with that in mind.
Summary: HTTP DELETE Method
The DELETE request and a URL are enough to delete a resource, but remember that these requests are powerful and can be irreversible. Use it with caution.