R2
Cors
Cors endpoint reference.
Get
Get the CORS configuration for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->cors()->get('ACCOUNT_ID', 'BUCKET_NAME', 'JURISDICTION');
Update
Set the CORS configuration for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
rules | array | Yes | CORS rules to set on the bucket. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->cors()->update('ACCOUNT_ID', 'BUCKET_NAME', [], 'JURISDICTION');
Delete
Delete the CORS configuration for a bucket.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
accountId | string | Yes | Account Identifier. | |
bucketName | string | Yes | Bucket Name. | |
jurisdiction | string|null | No | Jurisdiction where objects in this bucket are guaranteed to be stored. |
php
$response = $client->r2()->cors()->delete('ACCOUNT_ID', 'BUCKET_NAME', 'JURISDICTION');

