You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Python连接SharePoint遇URI解析错误及500错误求助

SharePoint API调用错误修复方案

问题核心

调用getFolderByServerRelativeUrl时传入了完整绝对URL,但该SharePoint API要求参数为服务器相对路径(从站点根目录开始、不带域名的路径);同时路径中的站点名称疑似存在笔误(Kmysharepointpage比认证站点多了一个K),这两个问题导致URI格式解析失败,触发500内部错误。

修复步骤

  1. 修正路径参数格式:
    将getFolderByServerRelativeUrl的参数从完整URL(https://mycompany.sharepoint.com/sites/Kmysharepointpage/Documents%20partages/General/)改为服务器相对路径,示例:

    '/sites/Kmysharepointpage/Documents%20partages/General/'
    

    也可使用解码空格后的格式:

    '/sites/Kmysharepointpage/Documents partages/General/'
    
  2. 检查站点名称拼写:
    确认目标站点名称是否为Kmysharepointpage——你认证的站点是mysharepointpage,此处多了一个K,若为笔误需修正为正确名称,否则路径指向的站点不存在也会报错。

  3. 修正后的请求URL示例:

    https://mycompany.sharepoint.com/sites/mysharepointpage/_api/Web/getFolderByServerRelativeUrl('/sites/Kmysharepointpage/Documents%20partages/General/')/Files
    

内容的提问来源于stack exchange,提问作者Gorkem Tunc

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 20:45:34