Skip to main content

send_json

Send a JSON HTTP response. Automatically sets the Content-Type header to application/json if not already set.

Parameters

NameDescriptionTypeDefault
dataData to be serialized to JSON. Defaults to empty dict.Union[Dict, List]{}
status_codeHTTP status code. Defaults to 200.int200
headersHTTP response headers. Defaults to empty dict. BadSendResponse: If status_code is not an integer or headers is not a dictionary.Dict[str, str]{}

Return Value

None