Complete the code to import the Flask request object.
from flask import [1]
The request object is imported from Flask to access request data.
Complete the code to get the value of the 'username' parameter from a GET request.
username = request.args.get([1])Use request.args.get('username') to get the 'username' parameter from the URL query string.
Fix the error in accessing JSON data from a POST request.
data = request.[1]In Flask, use request.json to access parsed JSON data from a POST request, which returns a Python dictionary or None.
Fill both blanks to check if the request method is POST and get form data 'email'.
if request.method == '[1]': email = request.form.get('[2]')
Check if the method is 'POST' and get the 'email' field from form data.
Fill all three blanks to create a Flask route that accepts POST requests and reads JSON 'name' from the request.
@app.route('/submit', methods=[[1]]) def submit(): data = request.get_json() name = data.get([2]) return f"Hello, [3]!"
The route must accept 'POST' method, get the 'name' key from JSON data, and use the variable name in the return string.