1

I want to get List from Sharepoint using mobile devices therefore I am using REST API with DefaultCredentials,I have already given Read rights to my List but I am getting

The remote server returned an error: (401) Unauthorized

My Code Is:

HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("ListUrl");
request.Method = "GET";
request.Accept = "application/json;odata=verbose";
request.ContentType = "application/json;odata=verbose";
request.UseDefaultCredentials = true;
request.PreAuthenticate = true;
request.Credentials = System.Net.CredentialCache.DefaultCredentials;
WebResponse response = request.GetResponse();

Is it possible via REST API or any other solution?? Is there anything that I am missing???

  • Where are you using this? Console application / app? – Akhoy Sep 4 '15 at 8:17
  • I want to access it via mobile app means outside the SharePoint. I was to get SharePoint List anonymously. – BASEER HAIDER JAFRI Sep 4 '15 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.