首页 > 代码库 > sharepoint rest api 创建文档库 文件夹
sharepoint rest api 创建文档库 文件夹
function createFolder()
{
var requestHeaders = {
"Accept": "application/json;odata=http://www.mamicode.com/verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"Content-Type": "application/json;odata=http://www.mamicode.com/verbose"
};
$.ajax({
url: "https://winourway.sharepoint.cn/sites/test01/_api/lists/getByTitle(‘t2‘)/rootfolder/folders/add(url=\‘" + $("#childfolderName").val()+"\‘)",
method: "POST",
// body: "{ ‘__metadata‘: { ‘type‘: ‘SP.Folder‘ }, ‘ServerRelativeUrl‘: ‘Shared Documents/New Folder‘ }",
headers: requestHeaders,
success: function (data)
{
layer.msg("创建成功", {icon:1})
},
error: function (data)
{
console.log(data);
}
});
}
sharepoint rest api 创建文档库 文件夹