我正在尝试使用带有 REST API 的 SharePoint 2013 在现有列表中添加新项目。
这里有很好的文档:http: //msdn.microsoft.com/en-us/library/jj164022 (office.15).aspx#ListItems
我尝试添加项目的列表称为“资源”,因此我执行以下 http POST 操作来添加新项目:
POST https://<site>/apps/reserve/_api/lists/getbytitle('Resources')/items
X-RequestDigest: <digest_key>
Content-Type: application/json;odata=verbose
{
"__metadata": {"type": "SP.Data.ResourcesListItem"},
"Title": "New Title",
"Description": "New Description",
"Location": "Sunnyvale"
}
但我得到以下错误:
A type named 'SP.Data.ResourcesListItem' could not be resolved by the model.
When a model is available, each type name must resolve to a valid type.
所以我认为我没有正确的资源名称。在文档中,它说:
To do this operation, you must know the ListItemEntityTypeFullName property of the list
and pass that as the value of type in the HTTP request body.
但我不知道如何为我的列表获取 ListItemEntityTypeFullName,并且文档似乎没有解释如何 - 我从文档 (SP.Data.< LIST_NAME >ListItem") 复制了模式,但我想这是不对的.
如何找到我的列表的名称?