From the course: Flask Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Using GET and POST requests in Flask
From the course: Flask Essential Training
Using GET and POST requests in Flask
- [Instructor] So currently, with our website, if someone provides a URL and a short name for that and they hit Shorten, it goes through as a GET request. Meaning that all the data from that form is displayed up here inside of the URL. And this is what comes default with a GET request but we'd rather not have that information displayed. Instead, we'd like to have it come through a POST request, which will take all that information and not display it in the URL but instead, we can have access to it inside of that app.pie file. So, lets go ahead and move back into our home.html. To change our form from sending our information via a GET to instead being a POST we can say that the method is equal to a POST. It defaults to get, but if we explicitly say POST it will change it to POST. So we'll go ahead and save this file come back to our home page let's change this here and because we're in the development environment…
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.
Contents
-
-
-
Install Flask and Pipenv3m 11s
-
Create your first route in a Flask project6m 4s
-
(Locked)
Flask's development environment4m 56s
-
(Locked)
Page templates in Flask with Jinja4m 29s
-
(Locked)
Passing data into Flask apps with forms6m 11s
-
(Locked)
Passing form variables to other routes in Flask4m 20s
-
(Locked)
Using GET and POST requests in Flask3m 31s
-
-
-
-
-