Microsoft Graph API,添加 SharePoint 列表项突然对空字符串抛出异常。

huangapple go评论70阅读模式
英文:

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.

英文:

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.

Microsoft Graph API,添加 SharePoint 列表项突然对空字符串抛出异常。

huangapple
  • 本文由 发表于 2023年5月14日 09:12:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76245438.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定