Recall & Review
beginner
What does the GET HTTP method do?
GET requests data from a server. It asks the server to send back information without changing anything.
Click to reveal answer
beginner
How is the POST HTTP method used in Flask?
POST sends data to the server to create something new, like submitting a form. In Flask, you handle POST requests to receive and process this data.
Click to reveal answer
intermediate
What is the purpose of the PUT HTTP method?
PUT updates existing data on the server. It replaces the current version of a resource with the new data sent.
Click to reveal answer
beginner
Explain the DELETE HTTP method.
DELETE removes data from the server. When you send a DELETE request, you ask the server to delete a specific resource.
Click to reveal answer
intermediate
How do you specify allowed HTTP methods in a Flask route?
You use the methods parameter in the @app.route decorator, like @app.route('/path', methods=['GET', 'POST']). This tells Flask which HTTP methods the route accepts.
Click to reveal answer
Which HTTP method is typically used to retrieve data without changing it?
✗ Incorrect
GET requests data from the server without modifying it.
In Flask, how do you handle a form submission that creates new data?
✗ Incorrect
POST is used to send data to the server to create new resources.
Which HTTP method replaces an existing resource with new data?
✗ Incorrect
PUT updates or replaces an existing resource on the server.
What does the DELETE HTTP method do?
✗ Incorrect
DELETE removes a resource from the server.
How do you allow both GET and POST methods on a Flask route?
✗ Incorrect
You specify allowed methods with the methods list in the route decorator.
Describe the main purpose of each HTTP method: GET, POST, PUT, and DELETE.
Think about what each method does to data on the server.
You got /4 concepts.
Explain how to handle different HTTP methods in a Flask route and why it matters.
Consider how a web form submission differs from just loading a page.
You got /4 concepts.