finalize method

  1. @override
ByteStream finalize()
override

Freezes all mutable fields and returns a single-subscription ByteStream that will emit the request body.

Implementation

@override
ByteStream finalize() {
  // TODO: freeze fields and files
  final boundary = _boundaryString();
  headers['content-type'] = 'multipart/form-data; boundary=$boundary';
  super.finalize();
  return ByteStream(_finalize(boundary));
}