QCloudOptionsObjectRequest Class Reference

Inherits from QCloudBizHTTPRequest
Declared in QCloudOptionsObjectRequest.h
QCloudOptionsObjectRequest.m

Overview

COS 对象的跨域访问配置预请求的方法.

功能说明

跨域访问配置的预请求是指在发送跨域请求之前会发送一个 OPTIONS 请求并带上特定的来源域,HTTP 方法 和 header 信息等给 COS,以决定是否可以发送真正的跨域请求.

关于COS 对象的跨域访问配置预请求接口的具体描述,请查看https://cloud.tencent.com/document/product/436/8288.

示例

@code

QCloudOptionsObjectRequest* request = [[QCloudOptionsObjectRequest alloc] init];

request.bucket =@"存储桶名";

request.origin = @"*";

request.accessControlRequestMethod = @"get";

request.accessControlRequestHeaders = @"host";

request.object = @"对象名";

[request setFinishBlock:^(id outputObject, NSError* error) {

}];
[[QCloudCOSXMLService defaultCOSXML] OptionsObject:request];

  object

对象的key

@property (strong, nonatomic) NSString *object

Declared In

QCloudOptionsObjectRequest.h

  bucket

存储桶名

@property (strong, nonatomic) NSString *bucket

Declared In

QCloudOptionsObjectRequest.h

  origin

模拟跨域访问的请求来源域名

@property (strong, nonatomic) NSString *origin

Declared In

QCloudOptionsObjectRequest.h

  accessControlRequestMethod

模拟跨域访问的请求HTTP方法

@property (strong, nonatomic) NSString *accessControlRequestMethod

Declared In

QCloudOptionsObjectRequest.h

  accessControlRequestHeaders

模;模拟跨域访问的请求头部

@property (strong, nonatomic) NSString *accessControlRequestHeaders

Declared In

QCloudOptionsObjectRequest.h