send_json
Send a JSON HTTP response. Automatically sets the Content-Type header to application/json if not already set.
Parameters
Name | Description | Type | Default |
---|---|---|---|
data | Data to be serialized to JSON. Defaults to empty dict. | Union[Dict, List] | {} |
status_code | HTTP status code. Defaults to 200. | int | 200 |
headers | HTTP 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