From the course: Full Stack Web Development with Flask

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Deleting data using DELETE

Deleting data using DELETE

- [Instructor] Deleting data using DELETE In this video, we're going to look at the API to handle the DELETE requests. DELETE is one of the HTTP verbs used again for the REST API CRUD operations. In this diagram here, this table you'll see that DELETE is basically to remove existing data. The API will be the API slash with an ID. So pass an ID to that, and then we'll search in the database, collection in the document, and remove that from the collection. So let's see, and let's go and implement this feature. Alright, in the Visual Studio Code, I'm going to open the routes. Okay, and it does take an id, so make sure you put in the second route pattern here. And, go here and create our DELETE function. It takes the self and the id. Again just have to basically remove that from the collection. Nothing more than that. Very simple, very much just like they put here. So, I'm just going to call the user objects and then…

Contents