使用Curl脚本创建的页面。没有出现在合流页面上。需要建议吗

2024-04-26 09:16:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我一直致力于使用以下curl脚本创建一个聚合页面。在

curl -v -S -u user:pass -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"TestPage","space":{"key":"Cloud"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' https://Client.atlassian.net/wiki/display/CD/Applications | python -mjson.tool

脚本执行良好,并显示了成功的结果。但是,该页面不会显示在Confluence Wiki页面上。在

^{pr2}$

你知道我在这个配置中遗漏了什么吗??。请帮忙。在


Tags: 脚本jsonapplicationtitletypepagestoragepass
1条回答
网友
1楼 · 发布于 2024-04-26 09:16:01

听起来好像您没有使用正确的URL通过restapi创建页面。它必须是URL/rest/api/content/。例如,如果要在带有space key TST和正文This is a new page的空间中创建一个标题为new page的页面,则需要使用以下命令:

curl -u admin:admin -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"new page","space":{"key":"TST"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' http://<URL>:<port>/confluence/rest/api/content/ | python -mjson.tool

相关问题 更多 >