Setting Access Endpoints

Last updated: 2020-09-14 11:37:35

    Overview

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

    SDK API Reference

    For the parameters and method descriptions of all the APIs in the SDK, see Api Documentation.

    Custom endpoint

    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.

    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.

    CosXmlConfig config = new CosXmlConfig.Builder()
      .setEndpointSuffix("cos.accelerate.myqcloud.com")
      .Build();

    Note:

    For the complete sample, go to GitHub.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help