U )._@sdZddlmZddlmZddlmZddlm Z ddl m Z ddl mZGd d d e Z Gd d d ee ZGd ddee ZdS)z flask.wrappers ~~~~~~~~~~~~~~ Implements the WSGI wrappers (request and response). :copyright: 2010 Pallets :license: BSD-3-Clause ) BadRequest)Request)Response) JSONMixin)json) current_appc@seZdZeZddZdS)rcCs"trtjrtd|tdS)Nz!Failed to decode JSON object: {0})rdebugrformat)selfer C:\Users\Miouzora\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\flask/wrappers.pyon_json_loading_faileds z JSONMixin.on_json_loading_failedN)__name__ __module__ __qualname__rZ json_modulerr r r rrsrc@sHeZdZdZdZdZdZeddZeddZ eddZ d d Z dS) raThe request object used by default in Flask. Remembers the matched endpoint and view arguments. It is what ends up as :class:`~flask.request`. If you want to replace the request object used you can subclass this and set :attr:`~flask.Flask.request_class` to your subclass. The request object is a :class:`~werkzeug.wrappers.Request` subclass and provides all of the attributes Werkzeug defines plus a few Flask specific ones. NcCstrtjdSdS)z8Read-only view of the ``MAX_CONTENT_LENGTH`` config key.ZMAX_CONTENT_LENGTHN)rconfigr r r rmax_content_lengthAszRequest.max_content_lengthcCs|jdk r|jjSdS)zThe endpoint that matched the request. This in combination with :attr:`view_args` can be used to reconstruct the same or a modified URL. If an exception happened when matching, this will be ``None``. N)url_ruleendpointrr r rrGs zRequest.endpointcCs*|jr&d|jjkr&|jjdddSdS)z!The name of the current blueprint.rrN)rrrsplitrr r r blueprintQszRequest.blueprintcCs<t|tr8tjr8|jdkr8|js8ddlm}||dS)Nzmultipart/form-datar)attach_enctype_error_multidict) RequestBase_load_form_datarr mimetypefilesZ debughelpersr)r rr r rrWs  zRequest._load_form_data) rrr__doc__rZ view_argsZrouting_exceptionpropertyrrrrr r r rrs   rcs0eZdZdZdZddZefddZZS)raThe 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. If you want to replace the response object used you can subclass this and set :attr:`~flask.Flask.response_class` to your subclass. .. versionchanged:: 1.0 JSON support is added to the response, like the request. This is useful when testing to get the test client response data as JSON. .. versionchanged:: 1.0 Added :attr:`max_cookie_size`. z text/htmlcCs|S)N)get_data)r cacher r r_get_data_for_json{szResponse._get_data_for_jsoncstrtjdStt|jS)zRead-only view of the :data:`MAX_COOKIE_SIZE` config key. See :attr:`~werkzeug.wrappers.BaseResponse.max_cookie_size` in Werkzeug's docs. ZMAX_COOKIE_SIZE)rrsuperrmax_cookie_sizer __class__r rr&~s zResponse.max_cookie_size) rrrr Zdefault_mimetyper$r!r& __classcell__r r r'rrgs rN)r Zwerkzeug.exceptionsrZwerkzeug.wrappersrrrZ ResponseBaseZwerkzeug.wrappers.jsonrZ _JSONMixinrglobalsrr r r rs       I