如何使用curl更新页面而不覆盖内容? 我必须更新Atlassian页面的内容,但所有内容都会被覆盖。
我用:
curl -u login:password -X PUT -H "Content-Type:application/json" -d @json.txt https://mysite/rest/api/content/id | python -mjson.tool
有什么想法吗?
答案 0 :(得分:0)
根据您的问题,我了解您要编辑部分页面。如果是这种情况,您需要先获取内容,然后编辑内容,然后将内容传递到存储部分中的DataGrid
命令:
DataTable.Rows
有关您的信息,请在public class MyClass
{
public List<object> Collection1 { get; set; }
public List<List<object>> Collection2 { get; set; }
public void AddBinding()
{
var myClass = new MyClass()
{
Collection1 = new List<object>
{
"Item1",
"Item2",
"Item3",
"Item4",
},
Collection2 = new List<List<object>>
{
new List<object>
{
"Value1 linked to Item1",
"Value2 linked to Item2",
"Value3 linked to Item3",
"Value4 linked to Item4",
},
new List<object>
{
"Value5 linked to Item1",
"Value6 linked to Item2",
"Value7 linked to Item3",
"Value8 linked to Item4",
},
}
};
var grid = new DataGrid();
grid.DataContext = myClass;
grid.Columns.Add(new DataGridTextColumn()
{
Binding = new Binding("Item1")
});
grid.Columns.Add(new DataGridTextColumn()
{
Binding = new Binding("Item2")
});
grid.Columns.Add(new DataGridTextColumn()
{
Binding = new Binding("Item3")
});
grid.Columns.Add(new DataGridTextColumn()
{
Binding = new Binding("Item4")
});
}
}
后面显示该页面的内容:
curl
有关Confluence REST API的更多信息,请查看Atlassian官方文档here。