json method

Future json(
  1. Object? json
)

Helper method for those used to res.json()

Implementation

Future json(Object? json) {
  headers.contentType = ContentType.json;
  write(jsonEncode(json));
  return close();
}