How can I update/merge Web.MembersCanShare property-value from the Sharepoint REST API

喜你入骨 提交于 2020-01-16 08:38:10

问题


GET https://microsoft.sharepoint.com/****/_api/Web/MembersCanShare

returns 'true'

200 OK
<?xml version="1.0" encoding="utf-8"?>
<d:MembersCanShare xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="Edm.Boolean">
    true
</d:MembersCanShare>

then request to update to 'false'

POST https://microsoft.sharepoint.com/****/_api/Web/
X-HTTP-Method:MERGE
If-Match:*
Content-Type:application/json;odata=verbose

{
    "MembersCanShare":false,
    "__metadata":
    {
        "type":"SP.Web"
    }
}

returns:

204 No Content

then GET https://microsoft.sharepoint.com/****/_api/Web/MembersCanShare

still returns 'true'

200 OK
<?xml version="1.0" encoding="utf-8"?>
<d:MembersCanShare xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="Edm.Boolean">
    true
</d:MembersCanShare>

...what am I doing wrong?

I've used this stack overflow question as a reference: Set Web properties of a site using SharePoint rest api

Thank you

来源:https://stackoverflow.com/questions/59054606/how-can-i-update-merge-web-memberscanshare-property-value-from-the-sharepoint-re

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!