Helper method for those used to res.json()
Future json(Object? json) { headers.contentType = ContentType.json; write(jsonEncode(json)); return close(); }