403 Forbidden Access Error when accessing public Github API

Jun 8 2013 11:46 AM
So I am trying to simply get a list of public repos. No oAuth authentication is required, and if I browse to http://api.github.com/users/[user]/repos , I get a JSON response. 

However, in the code I keep getting this 403 Error all the time! What am I doing wrong ?

Here's a copy of my code

             ServicePointManager.ServerCertificateValidationCallback = new                   System.Net.Security.RemoteCertificateValidationCallback(AcceptAllCertifications);
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3;

            string url = "https://api.github.com/users/[user]/repos";



            HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);

            request.Method = "GET";
            request.ContentType = "application/x-www-form-urlencoded";
            WebResponse ws = request.GetResponse();