json method

void json(
  1. Map<String, dynamic> data, {
  2. int status = HttpStatus.ok,
})

Set json response

Implementation

void json(Map<String, dynamic> data, {int status = HttpStatus.ok}) {
  contentType = ContentType.json;
  body = jsonEncode(data);
}