Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
1  
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
1  
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
add comment

1 Answer

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 vishsharepoint.blogspot.co.uk/2012/05/… –  Muhammad Raja May 17 '12 at 10:01
add comment

Your Answer

 
discard

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.