【发布时间】:2020-05-19 08:28:19
【问题描述】:
使用 Tampermonkey,我想在 HCL Connections 6.6 中的现有 wiki 中创建一个 wiki 页面。 According to the documentation,我构建了这个函数:
function createWikiPage(cnxBase) {
let wikiLabel = 'API Test Wiki'
let url = `${cnxBase}/wikis/basic/api/wiki/${wikiLabel}/feed`
let body = `
<entry xmlns="http://www.w3.org/2005/Atom">
<title type="text">Matt's Page6</title>
<summary type="text">My test</summary>
<content type="text">This is James's wiki page.</content>
<category term="wikipagetag1" />
<category term="wikipagetag2" />
<category term="wikipagetag3" />
<category scheme="tag:ibm.com,2006:td/type" term="page" label="page" />
</entry>
`
let args = {
method: "POST",
url: url,
data: body,
headers: {
"Content-Type": "application/atom+xml"
},
onload: function(response) {
alert(response.status + ' ' + response.responseText);
}
}
GM_xmlhttpRequest(args)
}
在调用createWikiPage('https://cnx-host') 后创建了带有标签的wiki 页面,但没有任何内容。此外,当我在浏览器中编辑页面并切换到 html 源代码时,我在内容中看不到任何字符。
为什么官方的例子不起作用?
【问题讨论】:
标签: xml api wiki tampermonkey ibm-connections