下面是我使用访问令牌和 application/json 内容类型传递的 json。
{
"isOnlineMeeting": true,
"subject": "Work Today",
"attendees": [
{
"emailAddress": {
"address": "[email protected]",
"name": "Mohit Gupta"
},
"type": "required"
}
],
"start": {
"dateTime": "2023-05-04T16:00:00",
"timeZone": "India Standard Time"
},
"onlineMeetingProvider": "teamsForBusiness",
"end": {
"dateTime": "2023-05-04T16:30:00",
"timeZone": "India Standard Time"
},
"body": {
"subject": "HTML",
"content": "I am working hard"
}
}
在此 api 上的 POST 请求后 - https://learn.microsoft.com/en-us/graph/api/calendar-post-events?view=graph-rest-1.0&tabs=http
POST /users/{id}}/calendar/events
我收到以下错误。 发生异常 org.springframework.web.client.HttpClientErrorException$BadRequest: 400 错误请求:
[
{
"error": {
"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize "
}
}
]
找不到问题。
我想这个问题在
...
"body": {
"subject": "HTML",
"content": "I am working hard"
}
...
物业应该是
contentType
不是subject
"body": {
"contentType": "HTML",
"content": "I am working hard"
}