json method

dynamic json (
  1. dynamic data
)

Implementation

json(data) {
  this.statusCode = 200;
  this.headers.add('Content-Type', 'application/json');
  this.write(c.json.encode(data));

  this.close();
}