This document describes how to request a COS service using a non-default COS endpoint.
For the parameters and method descriptions 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 endpoint.
CosXmlConfig config = new CosXmlConfig.Builder()
.SetRegion("COS_REGION") // Set 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.
Was this page helpful?