dumps
Serialize data as JSON. If :data:~flask.current_app is available, it will use its :meth:app.json.dumps() < flask.json.provider.JSONProvider.dumps > method, otherwise it will use :func:json.dumps.
def dumps(
obj: t.Any,
kwargs: t.Any
) - > str
Serialize data as JSON. If current_app is available, it will use its app.json.dumps() method, otherwise it will use json.dumps.
Parameters
| Name | Type | Description |
|---|---|---|
| obj | t.Any | The data object to be serialized into a JSON string. |
| kwargs | t.Any | Additional keyword arguments passed to the underlying JSON provider's dumps implementation. |
Returns
| Type | Description |
|---|---|
str | A string containing the JSON-formatted representation of the input object. |