json

suspend fun json(data: Any?, status: HttpStatusCode = HttpStatusCode.OK)

Sends a JSON response with the provided data.

Parameters

data

The data to send in the response.

status

The HTTP status code to return. Default is 200 OK.