文档

创建文件

该接口用于创建文件

请求方式POST/api/v3/projects/[ProjectId]/repository/files

请求Action:CreateFile

请求参数:

参数名

类型

说明

是否必须

默认值

ProjectId

long

代码库id

请求 body

{
  "branch_name": "string",
  "commit_message": "string",
  "content": "string",
  "encoding": "text",
  "file_path": "string"
}

body参数说明

参数名

类型

说明

是否必须

默认值

branch_name

string

文件所在分支

commit_message

string

提交信息

content

string

文件内容

encoding

string

编码规则

可选:

text

base64

text

file_path

string

文件路径

返回 body :

{
   "ErrorCode": "",
   "ErrorMessage": "",
   "RequestId": "",
   "Success": true,
   "Result": {
  "BranchName": "",
  "FilePath": "",
    }
}

返回结果说明:

参数名

类型

说明

BranchName

string

分支名称

FilePath

string

文件路径

  • 本页导读 (0)
文档反馈