as<T> method
Returns the request body as a class instance that is
initialized by the provided reviver
.
Example:
var person = await request.body.as(Person.fromJson);
Hint: The reviver function can't be factory constructor
Implementation
Future<T> as<T>(T Function(Map<String, dynamic>) reviver) async =>
Function.apply(reviver, [(await asJson)]) as T;