【发布时间】:2020-10-13 23:21:09
【问题描述】:
我在内部 .Net Core 3.1 webapi 中使用图形 api。但是,每次返回失败的响应时,它都会以 500 内部错误的形式返回,响应为 content-type: text/plain。
Status Code: NotFound
Microsoft.Graph.ServiceException: Code: Request_ResourceNotFound
Message: Resource '********' does not exist or one of its queried reference-property objects are not present.
Inner error:
AdditionalData:
date: 2020-10-13T13:44:21
request-id: 8053255b-2f1c-4543-8de7-*******
client-request-id: 8053255b-2f1c-4543-8de7-*******
ClientRequestId: 8053255b-2f1c-4543-8de7-*******
我正在寻找以 JSON 格式返回的响应,类似于 MS Graph Api 资源管理器,带有适当的错误代码,而不是 500 内部错误。
【问题讨论】:
-
我觉得这个案例和你的要求一样,可以参考里面的回复:stackoverflow.com/questions/62438792/…
-
这正是我的问题所在。谢谢@YongqingYu。
标签: asp.net-core microsoft-graph-api