Overview
This document describes how to request the COS service using a non-default endpoint.
Custom origin server domain name
The sample code below shows how to access a COS service using a custom origin server domain name.
Sample code
CosXmlConfig config = new CosXmlConfig.Builder()
.SetRegion("COS_REGION")
.SetHost("your.domain.com")
.Build();
Note:
For the complete sample, go to GitHub. Global acceleration endpoint
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
CosXmlConfig config = new CosXmlConfig.Builder()
.SetEndpointSuffix("cos.accelerate.myqcloud.com")
.Build();
Note:
For the complete sample, go to GitHub. Custom CDN domain name
The sample code below shows how to access a COS service using a custom CDN acceleration domain name.
Sample code
CosXmlConfig config = new CosXmlConfig.Builder()
.SetHost("exampledomain.com")
.Build();
Note:
For the complete sample, go to GitHub. Default CDN domain name
The sample code below shows how to access a COS service using a default CDN acceleration domain name.
Sample code
CosXmlConfig config = new CosXmlConfig.Builder()
.SetEndpointSuffix("file.myqcloud.com")
.Build();
Note:
For the complete sample, go to GitHub.
Apakah halaman ini membantu?