body method Null safety

String body(
  1. Uri uri,
  2. GeneratedMessage message
)

Transforms the given message into String which is used as HTTP POST body by postMessage, when the request is about to be sent to uri.

By default, transforms the message into bytes, and encodes it with Base64.

Implementation

String body(Uri uri, GeneratedMessage message) {
    var bytes = message.writeToBuffer();
    var result = _base64.encode(bytes);
    return result;
}