配置腾讯云COS认证参数 (cos.config)

声明

cos.config({secret_id = '密钥SecretId', secret_key = '密钥SecretKey', region = '区域Region', scheme = '传输模式'})

参数及返回值

  • secret_id
    • 文本型,腾讯云API的密钥SecretId,可以在"访问管理"->"访问密钥"->"API密钥管理"中设置。
  • secret_key
    • 文本型,腾讯云API的密钥SecretKey,可以在"访问管理"->"访问密钥"->"API密钥管理"中设置。
  • region
    • 文本型,腾讯云API区域Region,如ap-shanghai
  • scheme
    • 文本型,传输模式,可以填写为"https"或者"http"

说明

本方法用于做COS的初始化配置,必须在所有COS操作前运行。

示例

--列出当前用户下所有存储桶
--注意secret_id和secret_key请替换为你自己的。
cos.config({secret_id = '*****', secret_key = '*****', region = 'ap-shanghai', scheme = 'https'})
print(cos.list_buckets())
powered by GitbookFile Modify: 2021-03-27 23:14:19

results matching ""

    No results matching ""