tencent cloud

Feedback

Setting Access Domain Names (CDN/Global Acceleration)

Last updated: 2022-01-10 14:55:57

    Overview

    This document describes how to request the COS service using a non-default endpoint.

    SDK API References

    For the parameters and method description of all the APIs in the SDK, see API Documentation.

    Custom origin server domain name

    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.

    Sample code

    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.

    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

    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.

    Sample code

    CosXmlConfig config = new CosXmlConfig.Builder()
    .SetHost("exampledomain.com")
    .Build();
    
    Note:

    For the complete sample, go to GitHub.

    Default CDN domain name

    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.

    Sample code

    CosXmlConfig config = new CosXmlConfig.Builder()
    .SetEndpointSuffix("file.myqcloud.com")
    .Build();
    
    Note:

    For the complete sample, go to GitHub.

    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