asBlob property

HttpBlob? get asBlob

Implementation

HttpBlob? get asBlob {
  if (isBlob) {
    if (_body is HttpBlob) return _body;
    return createHttpBlob(_body as List<dynamic>, mimeType);
  } else if (isByteBuffer) {
    return createHttpBlob([_body], mimeType);
  } else if (isBytesArray) {
    return createHttpBlob([_body], mimeType);
  } else if (isString) {
    return createHttpBlob([_body], mimeType);
  } else if (isMap) {
    return createHttpBlob([asString], mimeType);
  }

  return null;
}