Cloudflare

Admin留言 | 贡献2023年9月22日 (五) 08:25的版本 (创建页面,内容为“== KV == === API === https://developers.cloudflare.com/api/operations/workers-kv-namespace-write-key-value-pair-with-metadata === 读取 === <syntaxhighlight lang="bash"> curl "https://api.cloudflare.com/client/v4/accounts/${account_identifier}/storage/kv/namespaces/${namespace_identifier}/values/${key_name}" \ -H "Authorization: Bearer ${API_TOKEN}" </syntaxhighlight> === 写入 === <syntaxhighlight lang="bash"> curl --request PUT \   --url https://api.c…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

KV

API

https://developers.cloudflare.com/api/operations/workers-kv-namespace-write-key-value-pair-with-metadata

读取

curl "https://api.cloudflare.com/client/v4/accounts/${account_identifier}/storage/kv/namespaces/${namespace_identifier}/values/${key_name}" \

-H "Authorization: Bearer ${API_TOKEN}"

写入

curl --request PUT \
  --url https://api.cloudflare.com/client/v4/accounts/${account_identifier}/storage/kv/namespaces/${namespace_identifier}/values/${key_name}" \
   -H "Authorization: Bearer ${API_TOKEN}"\
  -H 'Content-Type: multipart/form-data' \
  --form metadata='[]' --form value=${VALUE}