This document describes how to request the COS service using a non-default endpoint.
For the parameters and method description of all the APIs in the SDK, see API Documentation.
For more information, see Enabling Custom Origin Domain.
The sample code below shows how to access a COS service using a custom origin server domain name.
CosXmlConfig config = new CosXmlConfig.Builder()
.SetRegion("COS_REGION") // Sets the default bucket region
// Set the requested endpoint to “your.domain.com”
.SetHost("your.domain.com") // Custom endpoint
.Build();
Note:For the complete sample, go to GitHub.
For more information on global acceleration, see Overview.
The sample code below shows how to access a COS service using a global acceleration endpoint.
CosXmlConfig config = new CosXmlConfig.Builder()
.SetEndpointSuffix("cos.accelerate.myqcloud.com")
.Build();
Note:For the complete sample, go to GitHub.
For more information, see Enabling Custom CDN Acceleration Domain Names.
The sample code below shows how to access a COS service using a custom CDN acceleration domain name.
CosXmlConfig config = new CosXmlConfig.Builder()
.SetHost("exampledomain.com")
.Build();
Note:For the complete sample, go to GitHub.
For more information, see Enabling Default CDN Acceleration Domain Names.
The sample code below shows how to access a COS service using a default CDN acceleration domain name.
CosXmlConfig config = new CosXmlConfig.Builder()
.SetEndpointSuffix("file.myqcloud.com")
.Build();
Note:For the complete sample, go to GitHub.
Was this page helpful?