Skip to main content

dumps

Serialize data as JSON.

def dumps(
obj: t.Any,
kwargs: t.Any
) - > str

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.

Parameters

NameTypeDescription
objt.AnyThe data to serialize into a JSON string.
kwargst.AnyAdditional keyword arguments passed to the underlying JSON serialization implementation (either current_app.json.dumps() or json.dumps).

Returns

TypeDescription
strThe JSON serialized string representation of the object.