Complete the code to import the Response class from Flask.
from flask import [1]
The Response class is imported from Flask to create HTTP response objects.
Complete the code to create a Response object with the text 'Hello World'.
resp = Response([1])The Response constructor takes the response body as a string, so it must be quoted.
Fix the error in the code to set the status code of the Response to 404.
resp = Response('Not Found') resp.[1] = 404
The correct attribute to set the HTTP status code in Flask Response is status_code.
Fill both blanks to create a Response with JSON content and set the content type header.
resp = Response([1]) resp.headers['[2]'] = 'application/json'
Use json.dumps to convert a dictionary to a JSON string for the response body. The header key to set content type is Content-Type.
Fill all three blanks to create a Response with custom text, status 201, and a custom header.
resp = Response([1], status=[2]) resp.headers['[3]'] = 'CustomValue'
The response body is a string message. Status code 201 means resource created. Custom headers can have any name, here 'X-Custom-Header' is used.