javascript - 如何修复 ""code":"RequestBodyRead"" 错误?
问题描述
我正在尝试制作一个使用 Microsoft API 转发电子邮件的 Outlook 加载项,但我收到一条错误消息,指出根据文档,“评论”不是有效参数。我正在关注转发文档: 这里
var forwardMessage = Office.context.mailbox.restUrl +
'/beta/me/messages/' + itemId + '/forward';
var body= JSON.stringify({
"comment": item,
"toRecipients": [
{
"emailAddress": {
"address": "email@email.com",
"name": "name"
}
}
]
})
$.ajax({
url: forwardMessage,
method:"POST",
dataType: 'json',
headers: { 'Authorization': 'Bearer ' + accessToken,
'Content-Type': "application/json" },
data: body
}).then(
console.log("done")
)
}).catch(function(error){
throw error;
});
错误:
{"error":{"code":"RequestBodyRead","message":"The parameter 'comment' in the request payload is not a valid parameter for the operation 'Forward'."}}
解决方案
推荐阅读
- javascript - 收到错误“请求的模块'./three-csg.js'不提供名为'CSG'的导出”
- javascript - 从 [JSON 文件] 访问数据时,它显示未定义 In react js
- php - 在单引号和双引号内插入 php
- node.js - NPM 包的 Render.com Nodejs 部署问题
- model-view-controller - MVC - 在加载期间显示与默认不同的视图
- excel - 使用vba在工作表中有序排列图表
- iis - Blazor 应用程序在 IIS 中托管时不加载页面
- php - Wordpress 更改输入值
- javascript - For of { onclick = () => } 在 Javascript 中:在引用外部作用域变量的循环中声明的函数可能会导致语义混淆
- c# - 强制用户在 Authorization MS Graph 上选择帐户