我使用 SharePoint 2013 本地版本和在线版本进行集成。在访问在线 SharePoint 的 REST API 时,我可以毫无问题地使用application/json和application/xml作为标头。ACCEPT
但是,在访问 SharePoint 2013 本地 REST API 时,我可以使用application/xml作为ACCEPT标头并使用application/json抛出以下错误:
GET - http://xxxxxxx:8300/_api/web/
Header -
Accept:application/json
Response:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.ClientServiceException",
"message": {
"lang": "en-US",
"value": "The HTTP header ACCEPT is missing or its value is invalid."
}
}
}
Run Code Online (Sandbox Code Playgroud)
您能否建议我如何获取 LIST、LISTITEM 对象的 JSON 响应?