如果我在 Sharepoint 2016 Rest API 中使用标题接受“application/json;odata.metadata=minimal”在 url /_api/web/lists/GetByTitle('Pages')/Fields 和库页面 ( o 其他列表或库)有分类字段返回错误。
{
"odata.error": {
"code": "-2147467261, System.ArgumentNullException",
"message": {
"lang": "es-ES",
"value": "Value cannot be null.\r\nParameter name: type"
}
}
如果删除分类字段,则效果完美。
如果我使用带有分类字段的接受“application/json;odata=verbose”发出请求,也可以完美地工作。
总结:
如果我有分类字段 odata.metadata=minimal 则不起作用
致以诚挚的问候
根据我在 https://www.odata.org/getting-started/advanced-tutorial/#stq=minimal&stp=1 阅读文档的方式,您应该尝试使用 Content-Type 标头。
Content-Type: application/json;odata.metadata=minimal