bodyBytes property

  1. @override
Uint8List get bodyBytes
inherited

Gets this request's body as bytes (encoded version of body).

Implementation

@override
Uint8List get bodyBytes {
  if (_bodyBytes != null) return _bodyBytes!;
  if (_body != null) {
    return _bodyBytes = encoding.encode(_body!) as Uint8List;
  }
  return Uint8List.fromList([]);
}
  1. @override
set bodyBytes (List<int>? bytes)
inherited

Sets this request's body from bytes (encoded version of body).

Depending on the platform, this may be decoded to text prior to sending. Be sure to set encoding if this request body should be decoded with something other than the default utf-8.

Implementation

@override
set bodyBytes(List<int>? bytes) {
  verifyUnsent();
  _bodyBytes = bytes as Uint8List?;
  _body = null;
}