deleteObject method

dynamic deleteObject(
  1. String objectKey
)

Implementation

deleteObject(String objectKey) async {
  cosLog("deleteObject");
  var response = await getResponse("DELETE", objectKey);
  cosLog("request-id:" + (response.headers["x-cos-request-id"]?.first ?? ""));
  if (response.statusCode != 204) {
    cosLog("deleteObject error");
    String content = await response.transform(utf8.decoder).join("");
    throw COSException(response.statusCode, content);
  }
}