[英]How to retrieve data from a SharePoint List by using REST URL?
First, please assuming that my company domain name is www.aaa.com
, and I am trying to retrieve a list data from the SharePoint list REST endpoint. 首先,请假设我的公司域名为www.aaa.com
,并且我尝试从SharePoint列表REST终结点检索列表数据。 The list that I am trying to access is used in the following webpage: 我尝试访问的列表在以下网页中使用:
http://www.aaa.com/tpn/toolcenter/esri/Pages/Portal/Portal.aspx
And I can get the list names with: 我可以通过以下方式获取列表名称:
http://www.aaa.com/_vti_bin/ListData.svc/
and I think the list name that I am looking for is called "Pages". 而且我认为我要查找的列表名称称为“页面”。
Then I am trying to compose the Odata REST url to get the list data from browser but failed. 然后,我试图编写Odata REST URL来从浏览器获取列表数据,但是失败了。 The url that I tried is: 我尝试过的网址是:
http://www.aaa.com/sites/_api/lists/GetByTitle('Pages')
The error message that I get is a http 404
. 我收到的错误消息是http 404
。 Could anyone please let me know what might be wrong for my OData url? 有人可以让我知道我的OData网址出什么问题吗?
Appreciate your help very much! 非常感谢您的帮助!
The problem is where you're starting "_api". 问题是您从哪里开始“ _api”。
Assuming that "esri" is a site, try the following: 假设“ esri”是一个网站,请尝试以下操作:
http://www.aaa.com/tpn/toolcenter/esri/_api/lists/GetByTitle('Pages')
This url seems off too but I'm basing it on your sample. 这个网址似乎也没有,但我以您的样本为依据。 Basically, you start from the site where your list or library is stored, then append _api and everything else. 基本上,您从存储列表或库的站点开始,然后附加_api和其他所有内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.