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

Using GET and POST requests in Flask

From the course: Flask Essential Training

Start my 1-month free trial

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…

Contents