Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
&引用;表达式无效";执行SharePoint Rest调用时_Rest_Sharepoint_Odata_Sharepoint 2013 - Fatal编程技术网

&引用;表达式无效";执行SharePoint Rest调用时

&引用;表达式无效";执行SharePoint Rest调用时,rest,sharepoint,odata,sharepoint-2013,Rest,Sharepoint,Odata,Sharepoint 2013,我有一个SharePoint网站,当我打电话时 SITE/_api/web/lists/ 它给了我所有列表的数据,没问题。问题是,一旦我开始通过调用 SITE/_api/web/lists/getbytitle("Environments")/ 这给了我一个错误 Microsoft.SharePoint.Client.InvalidClientQueryExceptionThe expression "web/lists/getbytitle(Environ

我有一个SharePoint网站,当我打电话时

    SITE/_api/web/lists/  
它给了我所有列表的数据,没问题。问题是,一旦我开始通过调用

    SITE/_api/web/lists/getbytitle("Environments")/   
这给了我一个错误

    Microsoft.SharePoint.Client.InvalidClientQueryExceptionThe expression "web/lists/getbytitle(Environments)/items" is not valid. 
是我没有建立正确的URL,还是网站有问题。

在列表标题周围使用撇号(
)而不是引号


如果列表互动程序的标题中有撇号,则需要通过将每个撇号替换为
%27%27

来转义这些撇号。获取列表项的正确REST URL为:

http://site url/_api/web/lists/GetByTitle('Test')/items
列表名称周围缺少单引号


检查MSDN:

Getting:“表达式\”web/GetFileByServerRelativeUrl(“/Shared Documents/Ikeda Sensei's New Year's Message-2020.pdf”)/$value \“无效。”调用get file by server相对url API时。知道吗?@MayureshSrivastava文件名中有两个撇号,您需要用“%27%27”替换它们来转义。两个撇号分别在“唤醒”和“年份”中。我正在对返回的整个url进行编码:https:///_api/web/getfilebyserverrelativeurl(“/Shared%20Documents/Ikeda%20Sensei's%20New%20Year's%20Message%20-%202020.pdf”)/$value”仍然收到相同的错误。如果我按照你的建议做,https:///_api/web/getfilebyserverrelativeurl(“/Shared%20Documents/Ikeda%20Sensei%27s%20New%20Year%27s%20Message%20-%202020.pdf”)/$value,仍然是相同的错误。我尝试将-转换为%2D,但仍然相同。你能提出建议吗?试着用两个
%27%27
编码替换每个撇号,而不仅仅是一个
%27
。所以
https:///_api/web/GetFileByServerRelativeUrl(“/Shared Documents/Ikeda Sensei%27%27s新年信息-2020.pdf”)/$value
它似乎在工作,但为什么两个“%27%27”和我不确定如何处理这件事,因为我使用内置的编码方法进行编码,而这不是编码撇号,因为它是URL中的有效字符,显然我不能也不应该为特定文件手动编码。获取:“表达式\”web/GetFileByServerRelativeUrl('/Shared Documents/Ikeda Sensei's New Year's Message-2020.pdf')/$value\“无效。”在调用服务器相对url API获取文件时。有什么想法吗?调用get file by server RelativeUrl API时,“表达式\”web/GetFileByServerRelativeUrl('/Shared Documents/Ikeda Sensei's New Year's Message-2020.pdf')/$value \“无效”。有什么想法吗?