tencent cloud

All product documents
Cloud Object Storage
Setting Access Endpoints
Last updated: 2024-02-02 14:40:45
Setting Access Endpoints
Last updated: 2024-02-02 14:40:45

Overview

This document describes how to request the COS service by using a non-default domain name.

Custom Origin Server Domain Name

For more information, see Enabling Custom Origin Server Domains.
The sample code below shows how to access a COS service using a custom origin server domain name.

Sample code

// The bucket region can be viewed in the COS console at https://console.cloud.tencent.com/cos5/bucket/. For more information on regions, visit https://cloud.tencent.com/document/product/436/6224.
String region = "ap-beijing"; // Bucket region
String customDomain = "exampledomain.com"; // Custom origin server domain name

// Create a `CosXmlServiceConfig` object and modify the configuration parameters as needed
CosXmlServiceConfig serviceConfig = CosXmlServiceConfig(
region: region,
isDebuggable: false,
isHttps: true,
hostFormat: customDomain // Modify the requested domain name
);
// Register the default COS service
Cos().registerDefaultService(serviceConfig);

Global Acceleration Domain Name

For more information on global acceleration, see Overview.
The sample code below shows how to access a COS service using a global acceleration endpoint.

Sample code

// The bucket region can be viewed in the COS console at https://console.cloud.tencent.com/cos5/bucket/. For more information on regions, visit https://cloud.tencent.com/document/product/436/6224.
String region = "ap-beijing"; // Bucket region
// Whether to enable global acceleration
bool accelerate = true;
// Create a `CosXmlServiceConfig` object and modify the configuration parameters as needed
CosXmlServiceConfig serviceConfig = CosXmlServiceConfig(
region: region,
isDebuggable: false,
isHttps: true,
accelerate: accelerate // Use a global acceleration domain name
);
// Register the default COS service
Cos().registerDefaultService(serviceConfig);

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon