asString property

String? get asString

Implementation

String? get asString {
  final body = _body;

  if (body is String) {
    return body;
  } else if (body is ByteBuffer) {
    return bytesToString(body.asUint8List(), mimeType);
  } else if (body is List<int>) {
    return bytesToString(body.toUint8List(), mimeType);
  } else if (isMap) {
    return json.encode(body);
  } else {
    return null;
  }
}