Feature Overview
This document describes how to request the COS service by using a non-default domain name.
SDK API References
Default CDN acceleration domain name
The sample code below shows how to access a COS service using a default CDN acceleration domain name.
Sample code
Objective-C
QCloudCOSXMLEndPoint *endpoint = [[QCloudCOSXMLEndPoint alloc]init];endpoint.suffix = @"file.myqcloud.com";
Note
Swift
let endpoint = QCloudCOSXMLEndPoint();endpoint.suffix = "file.myqcloud.com";
Note
Custom CDN acceleration domain name
The sample code below shows how to access a COS service using a custom CDN acceleration domain name.
Sample code
Objective-C
QCloudCOSXMLEndPoint *endpoint = [[QCloudCOSXMLEndPoint alloc] initWithLiteralURL:[NSURL URLWithString:@"exampledomain.com"]];
Note
Swift
let endpoint = QCloudCOSXMLEndPoint.init(literalURL: NSURL.init(string: "exampledomain.com") as URL?);
Note
Custom origin domain name
The sample code below shows how to access a COS service using a custom origin server domain name.
Sample code
Objective-C
NSString *customDomain = @"exampledomain.com"; // Custom acceleration domain nameQCloudCOSXMLEndPoint *endpoint = [[QCloudCOSXMLEndPoint alloc] initWithLiteralURL:[NSURL URLWithString:customDomain]];
Note
Swift
let endpoint = QCloudCOSXMLEndPoint.init(literalURL: NSURL.init(string: "exampledomain.com") as URL?);
Note
Global acceleration domain name
The sample code below shows how to access a COS service using a global acceleration endpoint.
Sample code
Objective-C
QCloudCOSXMLEndPoint *endpoint = [[QCloudCOSXMLEndPoint alloc]init];endpoint.suffix = @"cos.accelerate.myqcloud.com";
Note
Swift
let endpoint = QCloudCOSXMLEndPoint();endpoint.suffix = "cos.accelerate.myqcloud.com";
Note