Alex

Alex

  • NA
  • 2
  • 7.1k

The Problem with using Wiki API in C#

Apr 30 2011 6:26 AM
Hello to everyone! Recently I've begun to wtite a small project in C# for creating ontologies from Wki. I'm using the Wiki api at the moment, but permanently got an error( Here is a code and an error:
<code>
System.Net.ServicePointManager.Expect100Continue = false;
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("http://en.wikipedia.org/w/api.php?action=query&titles=Car");
 
using (HttpWebResponse response = (HttpWebResponse)myRequest.GetResponse())
        {
                string ResponseText;
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
               {
                        ResponseText = reader.ReadToEnd();
                }
                SearchString.Text = ResponseText;
       }
</code>
and the error is
The remote server returned error 403.




Answers (3)