api - 通过 api rest 更新共享点文档的属性
问题描述
通过 api rest 更新共享点文档的属性。 图片 比如我想在文件test.html中编辑test列
解决方案
如果要更新文档名称,请尝试以下示例。
function CreateListItemWithDetails(listName) {
var item = {
"__metadata": { "type": "SP.Data.Shared_x0020_DocumentsItem" },
"FileLeafRef": "NBA2.PNG"
};
$.ajax({
url: _spPageContextInfo.siteAbsoluteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items(9)",
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify(item),
headers: {
"IF-MATCH": "*",
"X-HTTP-Method": "PATCH",
// Accept header: Specifies the format for response data from the server.
"Accept": "application/json;odata=verbose",
//Content-Type header: Specifies the format of the data that the client is sending to the server
"Content-Type": "application/json;odata=verbose",
// X-RequestDigest header: When you send a POST request, it must include the form digest value in X-RequestDigest header
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: function (data) {
console.log(data);
},
error: function (data) {
console.log(data);
}
});
}
推荐阅读
- mapkit - 在 mapkit.js 中获取地图的边界
- c# - 迭代上下文类型的查询结果时发生异常。连接已关闭
- c++ - SFML 在随机固定路径中移动精灵
- c++ - 如何在不从活动窗口中窃取焦点的情况下保持表单始终位于顶部?
- python - tkinter python网格功能无法正常工作
- python - 为什么要在 Pytorch 中为自定义层定义后向方法?
- regex - 处理复杂的正则表达式
- python - django.template.exceptions.TemplateDoesNotExist:/hello/
- c# - AWS Lambda 在 C# 中与 CodeCommit 交互
- angular - 为什么我的 Auth-guard 在未完成可观察代码的情况下停止?