Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Answer
403 Forbidden Access Error when accessing public Github API
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
United States Alhayek
11y
1.8k
1
Reply
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();
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
How can I link together the two user control?
Need to read the data from RS 232 to C#