QCloudDeleteObjectRequest Class Reference
Inherits from | QCloudBizHTTPRequest |
---|---|
Declared in | QCloudDeleteObjectRequest.h QCloudDeleteObjectRequest.m |
Overview
删除 COS 上单个对象的方法.
功能说明
COS 支持直接删除一个或多个对象,当仅需要删除一个对象时,只需要提供对象的名称(即对象键)即可.
关于删除 COS 上单个对象的具体描述,请查看 https://cloud.tencent.com/document/product/436/14119.
示例
@code
QCloudDeleteObjectRequest* deleteObjectRequest = [QCloudDeleteObjectRequest new];
// 存储桶名称,格式为 BucketName-APPID
deleteObjectRequest.bucket = @"examplebucket-1250000000";
// 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "dir1/object1"
deleteObjectRequest.object = @"exampleobject";
[deleteObjectRequest setFinishBlock:^(id outputObject, NSError *error) {
// outputObject 包含所有的响应 http 头部
NSDictionary* info = (NSDictionary *) outputObject;
}];
[[QCloudCOSXMLService defaultCOSXML] DeleteObject:deleteObjectRequest];
versionID
如果需要删除指定版本的Object,请在该参数中指定versionID(在开启了多版本的情况才有)
@property (strong, nonatomic) NSString *versionID
Declared In
QCloudDeleteObjectRequest.h