0
尝试在Atlassian wiki上创建维基页面。我以前使用Python脚本,该代码工作没有问题:发布到Atlassian Confluence api时意外的grunt-http错误
data = json.dumps({"type":"page", "data":"testData", "title":postTitle,"space":{"key":"EB"}, "body":{"storage":{"value": content,"representation":"storage"}}})
r = requests.post("https://estech.atlassian.net/wiki/rest/api/content/", data=data, headers=headers, auth=(confluenceLogin['username'], confluenceLogin['password']))
现在,我尝试使用下面的咕噜任务配置:
http: {
atlassianwiki: {
options: {
uri: atlassianURL + "/wiki/rest/api/content/",
headers: {"Content-Type": "application/json"},
auth: {
"user": confluencelogin,
"pass": confluencepass
},
method:"POST",
body: JSON.stringify(wikijson)
}
}
}
与wikijson看起来像:
wikijson = {
"type": "page",
"data": "testData",
"title": "testtitle",
"space": {key:"EB"},
"body": {
"storage": {
"value": "<p>testing posting</p>",
"representation": "storage"
}
}
}
我在执行此任务时遇到以下错误:
Fatal error: 500 {"statusCode":500, "message":"java.io.EOFException: No content to map to Object due to end of input"}
经过一番Google-fu,我发现有些人声称他们通过在curl命令行中添加“--post302”来解决这个问题。但我并不真正了解或理解这里如何应用。
谢谢,我希望这是有道理的。