Skip to main content

Response

The response object that is used by default in Flask. Works like the response object from Werkzeug but is set to have an HTML mimetype by default. Quite often you don't have to create this object yourself because :meth:~flask.Flask.make_response will take care of that for you.

Attributes

AttributeTypeDescription
default_mimetype`strNone` = "text/html"
json_module= jsonThe JSON module used for handling JSON data within the response, useful for testing to get test client response data as JSON.
autocorrect_location_header= FalseThis attribute controls whether the Location header is automatically corrected.

Methods


@classmethod
def max_cookie_size() - > int

Read-only view of the :data:MAX_COOKIE_SIZE config key. See :attr:~werkzeug.wrappers.Response.max_cookie_size in Werkzeug's docs.

Returns

TypeDescription
int