如何使用curl将文件上传到Atlassian Confluence页面

如何使用curl将文件上传到Atlassian Confluence页面,第1张

概述我正在尝试按照Remote API文档中给出的指南将.xls文件上传到Confluence wiki页面: https://developer.atlassian.com/confdev/confluence-server-rest-api/confluence-rest-api-examples#ConfluenceRESTAPIExamples-Uploadanattachment curl 我正在尝试按照Remote api文档中给出的指南将.xls文件上传到Confluence wiki页面:
https://developer.atlassian.com/confdev/confluence-server-rest-api/confluence-rest-api-examples#ConfluenceRESTAPIExamples-Uploadanattachment
curl -v -S -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" -F "comment=this is my file" "http://localhost:8080/confluence/rest/API/content/3604482/child/attachment" | python -mJson.tool

这就是我在做的事情:

curl -v -S -u username:password -X POST -H "X-Atlassian-Token: nocheck" -F "file=@/path/to/local/excelsheet.xls" https://<Confluence server>/display/page

我省略了python -mJson.tool,因为它说’没有JsON对象可以被解码’而且它没有意义,因为我没有发布Json.

但是上面的curl命令对我不起作用.我在控制台上看到目标页面的HTML,文件没有上传.我试过用几种方法修改curl命令,但没有任何效果.此外,对于我尝试上传到的页面的网址,它没有文档中建议的任何contentID.目标网址是一个接受附件并显示上传文件列表的页面.

有人可以指出我哪里出错了吗?我对Curl没有多少经验.

提前致谢.

解决方法 你需要在url中使用REST API:… / confluence / rest / API / content / $PAGE_ID / child / attachment现在你正在使用视图页面的url. 总结

以上是内存溢出为你收集整理的如何使用curl将文件上传到Atlassian Confluence页面全部内容,希望文章能够帮你解决如何使用curl将文件上传到Atlassian Confluence页面所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/1032957.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-24
下一篇2022-05-24

发表评论

登录后才能评论

评论列表(0条)

    保存