obs
查看跨域规则
更新时间:2021/02/08 GMT+08:00
您可以通过getBucketCORS查看桶的跨域规则。以下代码展示了如何查看跨域规则:
static OBSClient *client; NSString *endPoint = @"your-endpoint"; NSString *SK = @"*** Provide your Secret Key ***"; NSString *AK = @"*** Provide your Access Key ***"; // 初始化身份验证 OBSStaticCredentialProvider *credentailProvider = [[OBSStaticCredentialProvider alloc] initWithAccessKey:AK secretKey:SK]; //初始化服务配置 OBSServiceConfiguration *conf = [[OBSServiceConfiguration alloc] initWithURLString:endPoint credentialProvider:credentailProvider]; // 初始化client client = [[OBSClient alloc] initWithConfiguration:conf]; // 获取桶的跨域资源配置 OBSGetBucketCORSRequest *request = [[OBSGetBucketCORSRequest alloc] initWithBucketName:@"bucketname"]; [client getBucketCORS:request completionHandler:^(OBSGetBucketCORSResponse *response, NSError *error) { NSLog(@"%@",response); }];
父主题: 跨域资源共享
