0

这是我在共享点中创建新列表的URL。如何使用Rest服务在SharePoint 2013中添加新列表

http://mysite/_api/web/lists 

页眉

Accept:application/json 
odata:verbose 
X-RequestDigest:0x95F99ED44821F59DE52F628A82E4DFE6281D64349398251D47B063BEA15AA783C70656A30E0EC388C62E72E001B4F2BEB7AD716DAF1F63D79A170A8A4C299182,03 May 2016 07:01:30 -0000 
content-type:application/json; 
odata=verbose 
content-length:6 

身体

{ 
    "parameters": { 
     "__metadata": { 
      "type": "SP.List" 
     }, 
     "AllowContentTypes": true, 
     "BaseTemplate" : 100, 
     "ContentTypesEnabled": true, 
     "Description": "My ow list created", 
     "Title": "newList" 

    } 
} 

但是当试图执行在邮差这个网址我收到以下错误

<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> 
    <m:code>-2130575252, Microsoft.SharePoint.SPException</m:code> 
    <m:message xml:lang="en-US">The security validation for this page is invalid and might be corrupted. Please use your web browser's Back button to try your operation again.</m:message> 
</m:error> 

有人能指导我,为什么现在面临这个问题?

回答

0

此错误的可能原因是您的表单摘要已过期。

尝试用做一种新的形式通过使POST请求/_api/contextinfo端点消化,然后在部分更换。

我已经测试了以下代码正文它正在工作。

{ 
     "__metadata": { 
      "type": "SP.List" 
     }, 
     "AllowContentTypes": true, 
     "BaseTemplate" : 100, 
     "ContentTypesEnabled": true, 
     "Description": "My own list created", 
     "Title": "newList" 
    } 
相关问题