更新GitLab文件,并使用API中包含的.txt文件中包含的数据
我正在尝试使用gitlab api在我本地计算机上的文件中包含的数据来更新我的gitlab文件。 到目前为止,我能够通过添加一些文本来更新文件:
curl --request PUT --header "PRIVATE-TOKEN: MY_TOKEN \
--header "Content-Type: application/json" \
--data '{"branch": "master",
"author_email": "[email protected]", "author_name": "someone", "content": "some content", "commit_message": "update file"}' \
"https://gitlab.server.lan/api/v4/projects/xxxx/repository/files/my_file%2Fmy_yaml_file.yml"
但不能通过添加我喜好的TXT文件的内容。
我会感谢一些帮助!
I am trying to update a gitlab file of mine with data contained in a file on my local machine e.g. /tmp/output.txt using the gitlab API without success so far.
So far I am able to update a file by just adding some text:
curl --request PUT --header "PRIVATE-TOKEN: MY_TOKEN \
--header "Content-Type: application/json" \
--data '{"branch": "master",
"author_email": "[email protected]", "author_name": "someone", "content": "some content", "commit_message": "update file"}' \
"https://gitlab.server.lan/api/v4/projects/xxxx/repository/files/my_file%2Fmy_yaml_file.yml"
But not by adding the contents of a txt file of my preference.
I would be grateful for some help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论