getPrivateBlob method

Future getPrivateBlob(
  1. ContentId contentId,
  2. PrivateKey withPrivateKey
)

Implementation

Future<dynamic> getPrivateBlob(
    ContentId contentId, PrivateKey withPrivateKey) async {
  final resp =
      await getAuth('/privateBlob/${contentId.value}', withPrivateKey);
  if (resp.statusCode == HttpStatus.ok) {
    return resp.body;
  } else if (resp.statusCode == HttpStatus.notFound) {
    return null;
  }

  return Future.error(HttpResponseError(resp.statusCode, resp.body));
}