DELETE method endpoints

The DELETE method, as the name implies, is for deleting rows in a database.

DELETE /post/:slug. In Postman, we need to select the DELETE method, and in the URL you need to pass the slug of the post you want to remove. For example, let's remove the post my-blog-post-2. If you remove it correctly you should get a response with the removed node set to true:

If you want to verify the post was deleted, you can go to the /posts endpoint again, and you will see that is not in the JSON anymore:

Get React Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.