我正在尝试将CSV文件上传到我的Onedrive进行测试,但我找不到此处显示的URL端点末尾的/content是什么:https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/addressing-driveitems?view=odsp-graph-online
到目前为止,我所拥有的是:https://graph.microsoft.com/v1.0/me/drives/root:/{folderName}/test.csv:/content
但是我得到了一个错误:
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'content'.",
"innerError": {
"date": "2021-07-16T16:01:42",
"request-id": "bf4490df-5689-4016-b609-d85a3d6e8945",
"client-request-id": "ce01693e-ce87-61d4-c23b-79a28251818c"
}
}
} 这似乎是合法的,因为我没有在里面放任何真正的内容,但我不知道如何在URL中放入csv文件。我不确定我是否可以访问它的二进制值,因为我是从云解决方案发出请求的。
发布于 2021-07-17 03:11:52
您引用了/drives (复数),但没有提供驱动器Id。
如果你想上传到你的默认OneDrive,你需要使用/drive (单数):
PUT /me/drive/root:/{folderName}/test.txt:/contenthttps://stackoverflow.com/questions/68412080
复制相似问题