asBlob property

HttpBlob? asBlob

Implementation

HttpBlob? get asBlob {
  if (isBlob) {
    if (_body is HttpBlob) return _body as HttpBlob;
    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;
}