Learn R Programming

paws.storage (version 0.1.4)

s3_put_bucket_cors: Sets the CORS configuration for a bucket

Description

Sets the CORS configuration for a bucket.

Usage

s3_put_bucket_cors(Bucket, CORSConfiguration, ContentMD5)

Arguments

Bucket

[required]

CORSConfiguration

[required]

ContentMD5

Request syntax

svc$put_bucket_cors(
  Bucket = "string",
  CORSConfiguration = list(
    CORSRules = list(
      list(
        AllowedHeaders = list(
          "string"
        ),
        AllowedMethods = list(
          "string"
        ),
        AllowedOrigins = list(
          "string"
        ),
        ExposeHeaders = list(
          "string"
        ),
        MaxAgeSeconds = 123
      )
    )
  ),
  ContentMD5 = "string"
)

Examples

Run this code
# NOT RUN {
# The following example enables PUT, POST, and DELETE requests from
# www.example.com, and enables GET requests from any domain.
# }
# NOT RUN {
svc$put_bucket_cors(
  Bucket = "",
  CORSConfiguration = list(
    CORSRules = list(
      list(
        AllowedHeaders = list(
          "*"
        ),
        AllowedMethods = list(
          "PUT",
          "POST",
          "DELETE"
        ),
        AllowedOrigins = list(
          "http://www.example.com"
        ),
        ExposeHeaders = list(
          "x-amz-server-side-encryption"
        ),
        MaxAgeSeconds = 3000L
      ),
      list(
        AllowedHeaders = list(
          "Authorization"
        ),
        AllowedMethods = list(
          "GET"
        ),
        AllowedOrigins = list(
          "*"
        ),
        MaxAgeSeconds = 3000L
      )
    )
  ),
  ContentMD5 = ""
)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab