我有一个SharePoint网址完全正常,这指向生产环境,我使用带有getFileByName方法的nodejs来使用此网址 -
https://xxxx.sharepoint.com/sites/MSDS/Construction/_api/web/GetFileByServerRelativeUrl('/sites/MSDS/Construction/ProductLabels/xxxx.pdf')/$value
现在下面是质量服务器网址,根本不起作用 -
https://xxxx.sharepoint.com/sites/qa-MSDS/Construction/_api/web/GetFileByServerRelativeUrl('/sites/qa-MSDS/Construction/ProductLabels/xxxx.pdf')/$value
区别为qa-MSDS
而不是MSDS
,当我使用qa web api时,我得到以下错误 -
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-2147024809, System.ArgumentException</m:code>
<m:message xml:lang="en-US">
Server relative urls must start with SPWeb.ServerRelativeUrl
</m:message>
</m:error>
任何人都可以建议我做错了什么或如何在节点js环境中以更好的方式解决这个问题?