Created
June 1, 2015 13:43
-
-
Save nycdotnet/9173d4ebb61810831b02 to your computer and use it in GitHub Desktop.
Get releases info from GitHub API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Net; | |
namespace getReleaseInfo | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string endPoint = "https://api.github.com/repos/nycdotnet/TSqlFlex/releases"; | |
string userAgent = "nycdotnet/TSQLFlex"; | |
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(endPoint); | |
req.Method = "GET"; | |
req.Accept = "application/vnd.github.v3+json"; | |
req.UserAgent = userAgent; | |
using (HttpWebResponse response = (HttpWebResponse)req.GetResponse()) { | |
using (StreamReader reader = new StreamReader(response.GetResponseStream())) | |
{ | |
string jsonResult = reader.ReadToEnd(); | |
//do something with jsonResult. | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment