1

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()))
                {}}

Cheers

4
  • 1
    what is your question anyway ;)? May 16, 2012 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 May 16, 2012 at 20:20
  • 1
    Look at your tags! 2010/2007/list/xml/wtf? Which version of SharePoint are you actually using, 2007 or 2010?
    – Ryan
    May 17, 2012 at 8:20
  • sorry, 2007 is what i am using May 17, 2012 at 9:58

1 Answer 1

0

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

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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