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 module used for serialization and deserialization of JSON data within the response object.
autocorrect_location_headerboolean = falseA flag determining whether the Location header should be automatically converted to an absolute URL.
max_cookie_sizeintRead-only view of the MAX_COOKIE_SIZE config key.

Methods


@classmethod
def max_cookie_size() - > int

Read-only view of the :data:MAX_COOKIE_SIZE config key.

Returns

TypeDescription
intThe maximum allowed size for cookies in bytes, retrieved from the current application configuration or the Werkzeug default.