SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to get SPlist data using HTTPWebRequest but not sure how can i do it, here's the code I made until now,

                // Create a web request to get the xml feed
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(WEBURL);
            request.Method = "GET";
            request.Credentials = new NetworkCredential(_userName, _password);

            XmlDocument xml = null;
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            // If the request/response is successful
            if (response.StatusCode == HttpStatusCode.OK)
                // Get the response stream containing the xml
                using (XmlTextReader reader = new XmlTextReader(response.GetResponseStream()))


share|improve this question
what is your question anyway ;)? – Falak Mahmood May 16 '12 at 16:38
LOL question is, my code is half complete, and I dont know how to get the data using this XML reader lol – Muhammad Raja May 16 '12 at 20:20
Look at your tags! 2010/2007/list/xml/wtf? Which version of SharePoint are you actually using, 2007 or 2010? – Ryan May 17 '12 at 8:20
sorry, 2007 is what i am using – Muhammad Raja May 17 '12 at 9:58
up vote 0 down vote accepted

I am not really sure what you're trying to do with that code but I'll make an attempt at guessing anyway.

If you're using SharePoint 2007 then the way to access list data via a 'http request' is using the SharePoint web services.

MSDN - HOW TO : Return List Items

share|improve this answer
because I can't add web reference to a gadget , I will try using Javascript to do the same thing… – Muhammad Raja May 17 '12 at 10:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.