【问题标题】:How to upload files to SharepointOnline using curl on Linux如何在 Linux 上使用 curl 将文件上传到 SharepointOnline
【发布时间】:2022-01-01 22:20:51
【问题描述】:

我正在尝试自动将文件上传到 SharePoint Online。问题是我在尝试上传文件时不断收到 401 未经授权的错误。我创建了一个脚本来按照curl request to Microsoft Sharepoint API? 中的建议检索令牌,但上传仍然失败,即使我在运行curl -i -H "Authorization: Bearer $(./get_access_token.sh)" -H "Accept: application/json;odata=verbose" -s "https://YourTenant.sharepoint.com/_api/web" 时确实得到了肯定的响应。我有一种感觉,我只是在扭曲我的 curl 命令。对要使用的命令格式有什么建议吗?

【问题讨论】:

    标签: linux curl sharepoint-online sharepoint-rest-api


    【解决方案1】:

    这对我有用:

    curl --ntlm --user username:password --upload-file file.txt https://<sharePoint_folder_url>/file.txt -verbose
    

    【讨论】:

      猜你喜欢
      • 2023-03-29
      • 2023-03-08
      • 2015-11-11
      • 1970-01-01
      • 2016-09-15
      • 2018-05-22
      • 1970-01-01
      • 1970-01-01
      • 2020-02-26
      相关资源
      最近更新 更多