Parameter | Description | Type | Required |
Domain | The custom request domain name used to call a bucket or object API. You can use a template, such as "{$Bucket}.cos.{$Region}.myqcloud.com" which will use the bucket and region passed in the replacement parameters when an API is called. | String | No |
Protocol | The protocol used when the request is made. Valid values: https:, http:. By default, http: is used when the current page is determined to be in `http: format; otherwise, https: is used | String | No |
$bucket = "examplebucket-1250000000";$cosClient = new Qcloud\\Cos\\Client(array('domain' => $bucket . '.file.myqcloud.com', // Default acceleration domain name'schema' => 'https', // Protocol, http by default'credentials'=> array('secretId' => $secretId,'secretKey' => $secretKey)));
$cosClient = new Qcloud\\Cos\\Client(array('domain' => 'example-cdn-domain.com', // Default acceleration domain name'schema' => 'https', // Protocol, http by default'credentials'=> array('secretId' => $secretId,'secretKey' => $secretKey)));
$cosClient = new Qcloud\\Cos\\Client(array('domain' => 'example-cos-domain.com', // Default acceleration domain name'schema' => 'https', // Protocol, http by default'credentials'=> array('secretId' => $secretId,'secretKey' => $secretKey)));
// Change {$bucket}.cos.{$region}.myqcloud.com/key to the one below://{$bucket}.cos.accelerate.myqcloud.com/key$cosClient = new Qcloud\\Cos\\Client(array('schema' => 'https', // Protocol header, which is http by default'credentials'=> array('secretId' => $secretId,'secretKey' => $secretKey),'allow_accelerate' => true // Set this parameter to “true” to use a global acceleration domain.));
Apakah halaman ini membantu?