bodyAsList property

List? bodyAsList

Returns a mutable List parsed from the request body.

Note that parseBody must be called first.

Implementation

List? get bodyAsList {
  if (!hasParsedBody) {
    throw StateError('The request body has not been parsed yet.');
    // TODO: Relook at this
    //} else if (_bodyList == null) {
  } else if (_bodyList.isEmpty) {
    throw StateError('The request body, $_bodyObject, is not a List.');
  }

  return _bodyList;
}
void bodyAsList=(List? 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 bodyAsList(List? value) => bodyAsObject = value;