【问题标题】:How to upload powerpoint/word file through postman如何通过 postman 上传 powerpoint/word 文件
【发布时间】:2021-08-21 06:38:56
【问题描述】:

我的主要目标是使用 Microsoft Graph API 将 .pptx/.docx/.pdf 文件上传到 Microsoft Sharepoint。 能够使用以下“PUT”请求上传到简单的文本文件,其中内容类型为 multipart/form-data

https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/{simple.txt}:/content

但是对于 .pptx/.docx/.pdf 文件,虽然收到 “200 ok” 的响应,但在 sharepoint 站点文档中没有创建文件。

我已正确配置以“文件”为键的文件类型,并在邮递员的请求正文的值中选择了适当的文件。

观察 -> 上传 txt 文件时,响应为“201 created”,并且上传文件的内容正在更改。例如,如果内容是“Hello there”。上传文件内容为,

----------------404518839734975569926100 内容处置:表单数据;名称="文件";文件名="sample.txt" 内容类型:text/plain

你好 --------------404518839734975569926100--

有人可以解释这里发生了什么以及如何使用 MS Graph API 在 sharepoint 中上传 pptx/doc/pdf 文件。

【问题讨论】:

    标签: sharepoint microsoft-graph-api postman


    【解决方案1】:

    您可以像这样在 post man 中使用 Graph API 上传 .docx 文件。

    PUT drives/{drive-id}/root:/fileName.docx:/content
    

    在正文中,选择二进制类型。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-16
      • 2020-02-11
      • 1970-01-01
      • 1970-01-01
      • 2014-09-03
      • 2013-09-01
      • 2013-04-14
      相关资源
      最近更新 更多