Home / Function/ response() — flask Function Reference

response() — flask Function Reference

Architecture documentation for the response() function in provider.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  aec4f243_b66b_1e41_ea9e_51f8c611233d["response()"]
  a668812f_fdf3_10bc_0342_d263f9406af1["JSONProvider"]
  aec4f243_b66b_1e41_ea9e_51f8c611233d -->|defined in| a668812f_fdf3_10bc_0342_d263f9406af1
  41f60dba_c742_8eff_04cc_8577b192c235["response()"]
  41f60dba_c742_8eff_04cc_8577b192c235 -->|calls| aec4f243_b66b_1e41_ea9e_51f8c611233d
  8e862ec3_d7f5_8775_bc74_975e27aa89cb["jsonify()"]
  8e862ec3_d7f5_8775_bc74_975e27aa89cb -->|calls| aec4f243_b66b_1e41_ea9e_51f8c611233d
  9104e3d3_6e3d_cb00_d366_f06b8ffa8caa["_prepare_response_obj()"]
  9104e3d3_6e3d_cb00_d366_f06b8ffa8caa -->|calls| aec4f243_b66b_1e41_ea9e_51f8c611233d
  9104e3d3_6e3d_cb00_d366_f06b8ffa8caa["_prepare_response_obj()"]
  aec4f243_b66b_1e41_ea9e_51f8c611233d -->|calls| 9104e3d3_6e3d_cb00_d366_f06b8ffa8caa
  c50f4470_4854_122b_46a8_654e504d1d65["dumps()"]
  aec4f243_b66b_1e41_ea9e_51f8c611233d -->|calls| c50f4470_4854_122b_46a8_654e504d1d65
  41f60dba_c742_8eff_04cc_8577b192c235["response()"]
  aec4f243_b66b_1e41_ea9e_51f8c611233d -->|calls| 41f60dba_c742_8eff_04cc_8577b192c235
  298532b3_e403_bc7d_d6ab_a15e33dea870["dumps()"]
  aec4f243_b66b_1e41_ea9e_51f8c611233d -->|calls| 298532b3_e403_bc7d_d6ab_a15e33dea870
  style aec4f243_b66b_1e41_ea9e_51f8c611233d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/json/provider.py lines 89–105

    def response(self, *args: t.Any, **kwargs: t.Any) -> Response:
        """Serialize the given arguments as JSON, and return a
        :class:`~flask.Response` object with the ``application/json``
        mimetype.

        The :func:`~flask.json.jsonify` function calls this method for
        the current application.

        Either positional or keyword arguments can be given, not both.
        If no arguments are given, ``None`` is serialized.

        :param args: A single value to serialize, or multiple values to
            treat as a list to serialize.
        :param kwargs: Treat as a dict to serialize.
        """
        obj = self._prepare_response_obj(args, kwargs)
        return self._app.response_class(self.dumps(obj), mimetype="application/json")

Domain

Subdomains

Frequently Asked Questions

What does response() do?
response() is a function in the flask codebase, defined in src/flask/json/provider.py.
Where is response() defined?
response() is defined in src/flask/json/provider.py at line 89.
What does response() call?
response() calls 4 function(s): _prepare_response_obj, dumps, dumps, response.
What calls response()?
response() is called by 3 function(s): _prepare_response_obj, jsonify, response.

Analyze Your Own Codebase

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

Try Supermodel Free