From the course: Full Stack Web Development with Flask
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Inserting data using POST - Flask Tutorial
From the course: Full Stack Web Development with Flask
Inserting data using POST
- [Instructor] Inserting Data Using POST. In this video, we're going to create our API to handle all the POST requests. Now, POST is one of the HTTP verbs used for the REST API CRUD operations, as you can see on this diagram here. POST is to create and/or insert data using this endpoint with the API dash, with no data, no ID. So, let's go and implement this operation. Now, in Visual Studio Code, I'm going to open the routes.py, and. So, previously we created these two files here, all ready to function. I'm just going to go in here and put some comments so I remember, because it's going to get a little bit tricky here. This is the GET ALL. This one here is for the GET ONE, okay? Just one ID, 'cause we used ID here. So, the POST is going to go in here, because it doesn't take any parameters, right? So, make sure you put it in the right place, if you put it down here, if it gets, it's expecting an ID, it won't work.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.