英文:
Microsoft Graph API, Add SharePoint List Item suddenly throws exception for null strings
问题
我已成功向以下Graph API端点发出POST请求,以将项目添加到SharePoint列表中:https://graph.microsoft.com/v1.0/sites/[site-id]/lists/[list-id]/items
请求主体是:
{
"fields": {
"Title": "12345",
"Description": null
}
}
列表中的[Description]列只是一个不需要的单行文本字段,直到几天前,此请求一直正常工作,但是现在出现以下异常:
{
"error": {
"code": "generalException",
"message": "General exception while processing",
"innerError": {
"date": "2023-05-14T01:09:51",
"request-id": "f3b94466-e172-49de-8138-c11e0e20e253",
"client-request-id": "f3b94466-e172-49de-8138-c11e0e20e253"
}
}
}
如果我将Description的值从null更改为空字符串,请求将再次成功,但我不知道是什么导致了行为突然更改?
英文:
I have been successfully making a POST request to the following Graph API endpoint to add items to a SharePoint list: https://graph.microsoft.com/v1.0/sites/[site-id]/lists/[list-id]/items
The request body is:
{
"fields": {
"Title": "12345",
"Description": null,
}
}
The [Description] column in the list is just a single-line text field that is not required, up until a few days ago this request was working fine however, now it fails with the following exception:
{
"error": {
"code": "generalException",
"message": "General exception while processing",
"innerError": {
"date": "2023-05-14T01:09:51",
"request-id": "f3b94466-e172-49de-8138-c11e0e20e253",
"client-request-id": "f3b94466-e172-49de-8138-c11e0e20e253"
}
}
}
If I change the Description value from null to an empty string the request again succeeds but I have no idea what could have caused the sudden change in behavior?
答案1
得分: 0
I tested it in my local environment, and it works fine.
Since the error may be a temporary server-side issue, so I recommend waiting for a while before trying to see if the problem persists.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论