上传图片
POST/api/v5/repos/:owner/:repo/img/upload
Request
Path Parameters
owner stringrequired
仓库所属空间地址(企业、组织或个人的地址path)
repo stringrequired
仓库路径(path)
Query Parameters
access_token stringrequired
用户授权码
- application/json
Body
bodystringrequired
文件内容 base64(去掉Data URL)形式(限制20M)
file_namestringrequired
文件名
Responses
- 200
成功响应
Response Headers
- application/json
- Schema
- Example (auto)
- Example
Schema
successinteger
pathstring
full_pathstring
{
"success": 0,
"path": "string",
"full_path": "string"
}
{
"success": true,
"path": "uploads/4c98ad75-729f-49ce-82ab-b41c1f7ffc90/test3.txt",
"full_path": "https://gitcode.com/xiaogang/test/attachment/uploads/4c98ad75-729f-49ce-82ab-b41c1f7ffc90/test3.txt"
}