ok method
will response with status code 201 will end the request life-cycle the guards still work but the can not respond or modify the response any more
Implementation
Future<void> ok({
Object? data,
}) async {
/// set the Response contentType to Json
response.headers.contentType = io.ContentType.json;
/// set the status code
response.statusCode = io.HttpStatus.ok;
/// append the data to the response
await write(toJson(
{
'status_code': io.HttpStatus.ok,
'message': 'Ok',
if (data != null) 'data': data,
},
));
}