NANDHOO
.
Learning Paths
Dashboard
Sign In
Home
Dashboard
Flask Framework Engineering
Requests & Responses
Quiz
Chapter Quiz: Requests & Responses
Mastery Assessment: Requests & Responses
Complete this assessment with 100% score to master this chapter.
01
In Flask, how do you access the incoming JSON payload from a POST request?
request.json()
request.get_json()
request.body
request.payload
02
Why should you set the `httponly=True` flag when returning a secure cookie via `make_response`?
To compress the cookie data.
To prevent client-side JavaScript from accessing the cookie, mitigating XSS token theft.
To allow the cookie to be sent over HTTP instead of HTTPS.
To make the cookie permanent.
03
What happens if you try to access the `request` object outside of a valid Request Context (e.g., in a background thread without setup)?
It returns an empty dictionary.
It raises a RuntimeError: 'Working outside of request context'.
It returns the last request handled by the server.
It works normally but is slower.
Submit Answers
Back to Lesson
Next Chapter