我需要通过REST API创建一个融合页面。创建一个简单的页面是可行的,但是,如果我尝试向现有的HTML页面添加内容,则会收到http_response 400(错误请求)。
程式码片段:
confluence_page_content = File.open("local_html_report", "r").read
json_data = {
"body" => {
"storage" => {
"representation" => "storage",
"value" => "#{confluence_page_content}"
}
},
"space" => {
"key" => "#{test_parameters["confluence_space"]}"
},
"title" => "TestPageFromChef",
"type" => "page"
}.to_json
Run Code Online (Sandbox Code Playgroud)