json method

FutureOr json(
  1. Object? json
)

Helper method for those used to res.json()

Implementation

FutureOr<dynamic> json(Object? json) async {
  headers.contentType = ContentType.json;
  write(jsonEncode(json));
  return await close();
}