获取跨域配置

功能说明

获取指定 Bucket 的跨域配置。

方法原型

  1. func (s *BucketService) GetCORS(ctx context.Context) (*BucketGetCORSResult, *Response, error)

请求示例

  1. v, resp, err := client.Bucket.GetCORS(context.Background())

返回结果说明

  1. type BucketCORSRule struct {
  2. ID string
  3. AllowedMethods []string
  4. AllowedOrigins []string
  5. AllowedHeaders []string
  6. MaxAgeSeconds int
  7. ExposeHeaders []string
  8. }
参数名称参数描述类型必填
BucketCORSRule设置对应的跨域规则,包括 ID,MaxAgeSeconds,AllowedOrigin,AllowedMethod,AllowedHeader,ExposeHeaderstruct
ID设置规则的 IDstring
AllowedMethods设置允许的方法,如 GET,PUT,HEAD,POST,DELETE[]string
AllowedOrigins设置允许的访问来源,如 "http://cloud.tencent.com",支持通配符 []string
AllowedHeaders设置请求可以使用哪些自定义的 HTTP 请求头部,支持通配符 []string
MaxAgeSeconds设置 OPTIONS 请求得到结果的有效期int
ExposeHeaders设置浏览器可以接收到的来自服务器端的自定义头部信息[]string