Class JsonResponse
An HTTP response class that consumes data to be serialized to JSON.
Declaration
source linkDocumentation
:param data: Data to be dumped into json. By default only ``dict`` objects
are allowed to be passed due to a security flaw before EcmaScript 5. See
the ``safe`` parameter for more information.
:param encoder: Should be a json encoder class. Defaults to
``django.core.serializers.json.DjangoJSONEncoder``.
:param safe: Controls if only ``dict`` objects may be serialized. Defaults
to ``True``.
:param json_dumps_params: A dictionary of kwargs passed to json.dumps().
Methods
▶ def __init__(self, data, encoder=DjangoJSONEncoder, safe=True, json_dumps_params=None, ...) override