Recall & Review
beginner
What is the first step Flask takes when it receives an HTTP request?
Flask receives the HTTP request and creates a Request object that holds all the details like method, URL, headers, and data.
Click to reveal answer
beginner
How does Flask decide which function should handle an incoming HTTP request?
Flask matches the request URL and method to a route defined by the developer using decorators like @app.route(). This tells Flask which function to run.
Click to reveal answer
beginner
What role does the 'view function' play in Flask's request processing?
The view function is the code that runs after Flask matches the route. It processes the request and returns a response, like HTML or JSON.
Click to reveal answer
beginner
What happens after the view function returns a response in Flask?
Flask converts the returned value into an HTTP response object and sends it back to the client (browser or API caller).
Click to reveal answer
intermediate
How does Flask handle errors or requests that don’t match any route?
Flask returns an error response like 404 Not Found if no route matches. Developers can customize error handling with special error handler functions.
Click to reveal answer
What object does Flask create to hold details of an incoming HTTP request?
✗ Incorrect
Flask creates a Request object to store all information about the incoming HTTP request.
Which Flask decorator is used to link a URL to a function?
✗ Incorrect
The @app.route() decorator tells Flask which URL should trigger the decorated function.
What does a Flask view function return?
✗ Incorrect
The view function returns data or a response that Flask converts into an HTTP response sent to the client.
What status code does Flask return if no route matches the request URL?
✗ Incorrect
Flask returns a 404 Not Found error when no route matches the requested URL.
Which step comes directly after Flask matches a route to a request?
✗ Incorrect
After matching the route, Flask runs the view function to process the request.
Explain the journey of an HTTP request through Flask from arrival to response.
Think about what Flask does step-by-step when a browser asks for a page.
You got /4 concepts.
Describe how Flask handles a request that does not match any defined route.
What happens when you visit a page that does not exist in a Flask app?
You got /3 concepts.