This is the simplest way of writing views and URL routes in Flask. We can just write a method and decorate it with the endpoint. In this recipe, we will write a few URL routes for GET and POST requests.
Writing function-based views and URL routes
Getting ready
To go through this recipe, we can start with any Flask application. The app can be a new, empty, or any complex app. We just need to understand the methods outlined in this recipe.
How to do it...
The following section explains the three most widely used different kinds of requests, demonstrated by means of small...