Cloudflare

上传静态资源

上传静态资源

POST /cloudflare/client/v4/accounts/{account_id}/workers/assets/upload

Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.

支持状态: partial

Upload one batch as multipart form fields (hash → content; base64 when base64=true). Send the upload token as Authorization: Bearer and your API key in X-API-Key. Earlier batches answer 202; the last answers 201 with the completion token.

参数

名称位置类型必填说明
account_idpathstringtrueAny value; your account comes from the API key.
base64querybooleanfalseField values are base64.

请求体 (multipart/form-data)

必填: true

名称类型说明
{
  "type": "object",
  "additionalProperties": {
    "type": "string"
  },
  "description": "One form field per file: the field name is the hash, the value the content."
}

响应

HTTP 201

Success

application/json

名称类型说明
successbooleanAlways true on success.
errorsarray<any>Always empty on success.
messagesarray<any>Always empty on success.
resultobject
result.jwtstring | nullCompletion token after the last batch; null for earlier batches.
result_infoobjectPresent on list responses.
result_info.pageintegerPage number.
result_info.per_pageintegerPage size.
result_info.countintegerItems on this page.

HTTP 202

Batch stored; more batches remain (no completion token yet).

application/json

名称类型说明
successbooleanAlways true on success.
errorsarray<any>Always empty on success.
messagesarray<any>Always empty on success.
resultobject
result_infoobjectPresent on list responses.
result_info.pageintegerPage number.
result_info.per_pageintegerPage size.
result_info.countintegerItems on this page.
导出

本页内容