访问Sharepoint REST

时间:2013-02-20 18:06:34

标签: c# rest sharepoint

所以我试图远程从Sharepoint中提取一些列表

如果我在浏览器中输入“https://abc.sharepoint.com/_vti_bin/ListData.svc/MemberFirms”,我会返回该网站的XML。

如果我使用以下C#代码

HttpWebRequest request =
            (HttpWebRequest)HttpWebRequest
   .Create("https://abc.sharepoint.com/_vti_bin/ListData.svc/MemberFirms");
            request.KeepAlive = true;
            request.Method = "GET";
            request.Accept = "application/atom+xml";
            request.ContentType = "application/atom+xml;type=entry";
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            StreamReader reader = new StreamReader(response.GetResponseStream());

我在GetResponse上的连接超时了。有什么想法吗?

如果我取下了我得到的保持活力 基础连接已关闭:接收时发生意外错误。

0 个答案:

没有答案