rawBody property

Uint8List get rawBody

Raw binary request payload bytes.

Throws StateError if this request is a streaming request (e.g. multipart/form-data upload). To consume streaming bodies, use multipart.

Implementation

Uint8List get rawBody {
  if (_streamBody != null) {
    throw StateError(
      'Cannot access rawBody on a streaming request body. '
      'Use multipart() to consume the multipart stream.',
    );
  }
  return _rawBody ?? Uint8List(0);
}