← Flask learning pathFlask · Module 2 of 10
Routing and requests
Handle URLs, methods, query strings and form data.
📖 Key ideas
- Dynamic routes: @app.route("/user/<name>").
- Converters: <int:id>, <path:p>.
- Allow methods: methods=["GET", "POST"].
- request.args reads query strings; request.form reads form data.
- request.get_json() reads JSON bodies.
💡 Real-life example: Routes are post-office boxes: each number goes to the right function.
request.argsQuery string values
request.formForm fields
get_json()Parses JSON body
<int:id>Integer URL converter