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_header= falseWhether to automatically correct the Location header to be an absolute URL.
max_cookie_sizeintRead-only view of the :data:MAX_COOKIE_SIZE config key.

Constructor

Signature

def Response()

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.