bodyBytes property

Uint8List get bodyBytes

The bytes comprising the body of the request.

This is converted to and from body using encoding.

This list should only be set, not modified in place.

Unlike body, setting bodyBytes does not implicitly set a Content-Type header.

final request = Request('GET', Uri.https('example.com', 'whatsit/create'))
  ..bodyBytes = utf8.encode(jsonEncode({}))
  ..headers['content-type'] = 'application/json';

Implementation

Uint8List get bodyBytes => _bodyBytes;
set bodyBytes (List<int> value)

Implementation

set bodyBytes(List<int> value) {
  _checkFinalized();
  _bodyBytes = toUint8List(value);
}