Bitbucket Server REST Api更改文件

问题描述 投票:0回答:1

在Bitbucket的文档中,有关于如何通过Rest API更改文件的信息:

curl -X PUT -u username:password \
     -F  [email protected]  \
     -F 'message=Updated using file-edit REST API' \
     -F  branch=master \
     -F  sourceCommitId=5636641a50b \
     http://example.com/rest/api/latest/projects/PROJECT_1/repos/repo_1/browse/README.md

branch:应修改或创建路径的分支

content:路径中文件的完整内容

message:与此更改关联的消息,用作提交消息。如果应使用默认消息,则返回null。

sourceCommitId:编辑之前文件的提交ID,用于标识内容是否已更改。如果这是一个新文件,则返回null

但是当我调用我的脚本时:

curl -k -X PUT \
    -H "Authorization: Basic cnVhtrhjrthhtUUFaeHN3Mg==" \
    -F  [email protected] \
    -F "message=Updated using README" \
    -F  branch=master \
    https://bitbucket.company.com/rest/api/1.0/projects/project_name/repos/repo_name/browse/README.md

我收到这条消息:

Warning: setting file README.md  failed!

curl: (26) read function returned funny value. 

可能是什么问题呢?

bitbucket bitbucket-server bitbucket-api
1个回答
0
投票

正确的要求:

curl -X PUT -u用户名:密码-F content =一些更改-F'message =使用文件编辑REST API更新'-F branch = master -F sourceCommitId = 5636641a50b http://example.com/rest/api/latest/projects/PROJECT_1/repos/repo_1/browse/README.md

内容应该没有@

© www.soinside.com 2019 - 2024. All rights reserved.