get method Null safety
- String path,
- {String? versionId}
Implementation
Future<Uint8List> get(String path, {String? versionId}) async {
if (path.startsWith('/')) path = path.replaceFirst('/', '');
http.Response rsp = await http.get(_bucketUri.replace(
path: path,
query: versionId != null ? 'versionId=$versionId' : null,
));
if (rsp.statusCode == 200) {
return rsp.bodyBytes;
} else {
throw HttpException('HTTP Error ${rsp.statusCode}: ${rsp.body}');
}
}