【发布时间】:2019-10-01 06:31:18
【问题描述】:
我想下载一个文件的内容以便将它存储在本地机器中,我发送的请求是:
https://graph.microsoft.com/v1.0/me/drive/root:/test/file1.docx:/content
get.addHeader("Accept", "application/octet-stream"),
get.addHeader('Authorization', authcode);
get.addHeader('Cache-Control', 'no-store');
响应代码是 200 而不是 302。当我使用我的个人帐户时,响应标头是具有 Content-Location 的 jason 对象(它是一个下载 url)。到现在为止还挺好。 但是当我使用企业帐户时,响应代码为 200,但响应标头中没有 downaloadurl/contentlocation/ 或类似内容。 我认为所有权限都很好,Azure 中的范围设置为“Files.ReadWrite.All”。
PS:我不想下载文件,我想下载文件内容。 有什么建议么?
更新:看起来这是已知问题,https://github.com/microsoftgraph/microsoft-graph-docs/issues/5637 已经有案例了
【问题讨论】:
标签: api azure-active-directory microsoft-graph-api onedrive azure-ad-graph-api