bodyAsMap property

Map<String, dynamic> bodyAsMap

Returns a mutable Map of the fields parsed from the request body.

Note that parseBody must be called first.

Implementation

Map<String, dynamic> get bodyAsMap {
  if (!hasParsedBody) {
    throw StateError('The request body has not been parsed yet.');
  }
  // else if (_bodyFields == null) {
  //  throw StateError('The request body, $_bodyObject, is not a Map.');
  //}

  return _bodyFields;
}
void bodyAsMap=(Map<String, dynamic>? value)

This setter allows you to explicitly set the request body exactly once.

Use this if the format of the body is not natively parsed by Angel.

Implementation

set bodyAsMap(Map<String, dynamic>? value) => bodyAsObject = value;