I have a problem with my script in C#. I've tried list all public repositories in GitHub.
Here is my code:
HttpWebRequest request = WebRequest.Create("https://api.github.com/repositories?since=364") as HttpWebRequest;
request.Method = "GET";
request.Proxy = null;
request.ContentType = "application/json";
using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
{
StreamReader reader = new StreamReader(response.GetResponseStream());
content1= reader.ReadToEnd();
}
And i have error:
System.Net.WebException was unhandled by user code
The server committed a protocol violation. Section=ResponseStatusLine
Source=System
An exception of type 'System.Net.WebException' occurred in System.dll but was not handled in user code
on line with using....
Thanks for your help.