Pulls

上传文件。Upload files.

获取上传文件的 URL,使用 PUT 流式上传。 Get the upload URL for the file. Use PUT to initiate a streaming upload. 访问令牌调用此接口需包含以下权限。Required permissions for access token. repo-notes:rw

post/{repo}/-/upload/files

Request

  • Base URL: https://api.cnb.cool (the document declares no server; this is the origin it was published from)
  • URL: https://api.cnb.cool/{repo}/-/upload/files
  • Auth: API key in header Authorization

Path parameters

repostring required

不带.git后缀的仓库名称。格式:组织名称/仓库名称。Repository name without .git suffix. Format: org/repo.

Request body

extobject

文件扩展信息。File extension info.

namestring

文件名。File name.

sizeinteger

文件大小。File size.

Response

OK

formobject

上传表单参数。Upload form parameters.

tokenstring

后续调用 confirm 接口用的。Token for the subsequent confirm API call.

upload_urlstring

上传URL地址。Upload URL.

Example response

{
  "assets": {
    "path": "/{slug}/-/assets/xxx/xxx/xxxx-xxx.png"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.