- # Write data as JSON and set the right content type header.
- fun json(json: nullable Serializable, status: nullable Int) do
- header["Content-Type"] = media_types["json"].as(not null)
- if json == null then
- send(null, status)
- else
- send(json.to_json, status)
- end
- end
-