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
(self, *args: t.Any, **kwargs: t.Any)
| 87 | return args or kwargs |
| 88 | |
| 89 | def response(self, *args: t.Any, **kwargs: t.Any) -> Response: |
| 90 | """Serialize the given arguments as JSON, and return a |
| 91 | :class:`~flask.Response` object with the ``application/json`` |
| 92 | mimetype. |
| 93 | |
| 94 | The :func:`~flask.json.jsonify` function calls this method for |
| 95 | the current application. |
| 96 | |
| 97 | Either positional or keyword arguments can be given, not both. |
| 98 | If no arguments are given, ``None`` is serialized. |
| 99 | |
| 100 | :param args: A single value to serialize, or multiple values to |
| 101 | treat as a list to serialize. |
| 102 | :param kwargs: Treat as a dict to serialize. |
| 103 | """ |
| 104 | obj = self._prepare_response_obj(args, kwargs) |
| 105 | return self._app.response_class(self.dumps(obj), mimetype="application/json") |
| 106 | |
| 107 | |
| 108 | def _default(o: t.Any) -> t.Any: |