postman - 如何修复 - 更新 plannertaskdetails - If-Match 标头包含无效值
问题描述
我正在尝试更新 (PATCH) 现有的 Microsoft Planner 任务,以向其中添加一 (1) 个清单项。我正在使用 Microsoft doc https://docs.microsoft.com/en-us/graph/api/plannertaskdetails-update?view=graph-rest-1.0&tabs=javascript作为参考,并且我正在使用 Postman 发送请求.
{
"error": {
"code": "",
"message": "The If-Match header contains an invalid value.",
"innerError": {
"request-id": "7b50a25b-7c5a-443b-9a41-1b6314be4014",
"date": "2019-05-16T23:59:03"
}
}
}
据我所知,If-Match 键的构建方式与 Microsoft 文章中使用它的方式完全相同。我发现了一篇类似的文章(https://powerusers.microsoft.com/t5/Connecting-To-Data/Custom-Connector-Graph-The-If-Match-header-must-be-specified-for/td- p/144092),但是这个人以不同的方式填写 If-Match 值,它对我根本不起作用......
我首先从创建任务后收到的响应中重用了 eTAG 值:
"@odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc=\""
有谁知道我在这里做错了什么?
这是我的补丁:
https://graph.microsoft.com/v1.0/planner/tasks/n...................pYAM-DX/details
这些是我的标题:
Content-Type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJub..........
If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBARCc="
这是我的身体:
{
"previewType": "checklist",
"checklist": {
"{{$guid}}":{
"@odata.type": "microsoft.graph.plannerChecklistItem",
"title": "Update task details",
"isChecked": false
}
}
}
我期待 If-Match 键是正确的,因为我使用了 Microsoft 文章,但不知何故它会导致错误消息:
“If-Match 标头包含无效值。”
解决方案
我有类似的问题。更新任务详细信息时,我使用了任务中的 etag。任务和任务详细信息是不同的对象。检查 - MS Graph doc
使用以下命令从创建任务的任务详细信息中获取 etag 值:
GET https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details
推荐阅读
- python - 更改现有数据透视表python中的源数据
- java - Intellj Maven 项目无法启动“工件部署期间出错。有关详细信息,请参阅服务器日志。”
- ios - CocoaPods 在 Podfile 中找不到 pod XXXX 的兼容版本
- c# - 创建甘特图需要了解哪些技术?
- r - 当数据帧中的行数可能不同时,数据帧的并行 cbind
- button - 如何在 swiftui 中的按钮操作上的视图控制器之间导航?
- c - 使用 Openldap C 库在 linux 的 Active Directory 中设置下次登录时重置密码时更改密码
- gitlab - Gitlab显示远程:此服务器是只读的
- flutter - FLUTTER FIRESTORE - 查询字段并获取文档 ID 并检查其他字段
- google-chrome - 无法在 Chrome 80 中获取下载的项目