flask.Flask.make_response

Flask.make_response(rv)[source]

Converts the return value from a view function to a real response object that is an instance of response_class.

The following types are allowed for rv:

response_class the object is returned unchanged
str a response object is created with the string as body
unicode a response object is created with the string encoded to utf-8 as body
a WSGI function the function is called as WSGI application and buffered as response object
tuple A tuple in the form (response, status, headers) or (response, headers) where response is any of the types defined here, status is a string or an integer and headers is a list or a dictionary with header values.
Parameters:rv – the return value from the view function

Changed in version 0.9: Previously a tuple was interpreted as the arguments for the response object.