Home / Function/ process_response() — flask Function Reference

process_response() — flask Function Reference

Architecture documentation for the process_response() function in app.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  fb16d269_6190_8a73_3c8e_2aad2de3c329["process_response()"]
  792879e9_430c_854e_d046_ff41a9c758ac["Flask"]
  fb16d269_6190_8a73_3c8e_2aad2de3c329 -->|defined in| 792879e9_430c_854e_d046_ff41a9c758ac
  c72cd49a_5a3a_947f_e182_4751c5bdc55c["finalize_request()"]
  c72cd49a_5a3a_947f_e182_4751c5bdc55c -->|calls| fb16d269_6190_8a73_3c8e_2aad2de3c329
  d4ed9555_eddd_f1a0_945b_78945c15c295["ensure_sync()"]
  fb16d269_6190_8a73_3c8e_2aad2de3c329 -->|calls| d4ed9555_eddd_f1a0_945b_78945c15c295
  4e18a93c_5bc8_305a_394a_4603522147a0["is_null_session()"]
  fb16d269_6190_8a73_3c8e_2aad2de3c329 -->|calls| 4e18a93c_5bc8_305a_394a_4603522147a0
  8da9fc9c_44ae_8889_f7c0_ae3a0013ec62["save_session()"]
  fb16d269_6190_8a73_3c8e_2aad2de3c329 -->|calls| 8da9fc9c_44ae_8889_f7c0_ae3a0013ec62
  style fb16d269_6190_8a73_3c8e_2aad2de3c329 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/app.py lines 1393–1417

    def process_response(self, ctx: AppContext, response: Response) -> Response:
        """Can be overridden in order to modify the response object
        before it's sent to the WSGI server.  By default this will
        call all the :meth:`after_request` decorated functions.

        .. versionchanged:: 0.5
           As of Flask 0.5 the functions registered for after request
           execution are called in reverse order of registration.

        :param response: a :attr:`response_class` object.
        :return: a new response object or the same, has to be an
                 instance of :attr:`response_class`.
        """
        for func in ctx._after_request_functions:
            response = self.ensure_sync(func)(response)

        for name in chain(ctx.request.blueprints, (None,)):
            if name in self.after_request_funcs:
                for func in reversed(self.after_request_funcs[name]):
                    response = self.ensure_sync(func)(response)

        if not self.session_interface.is_null_session(ctx.session):
            self.session_interface.save_session(self, ctx.session, response)

        return response

Subdomains

Defined In

Called By

Frequently Asked Questions

What does process_response() do?
process_response() is a function in the flask codebase, defined in src/flask/app.py.
Where is process_response() defined?
process_response() is defined in src/flask/app.py at line 1393.
What does process_response() call?
process_response() calls 3 function(s): ensure_sync, is_null_session, save_session.
What calls process_response()?
process_response() is called by 1 function(s): finalize_request.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free