Skip to content

Instantly share code, notes, and snippets.

@nycdotnet
Created June 1, 2015 13:43
Show Gist options
  • Save nycdotnet/9173d4ebb61810831b02 to your computer and use it in GitHub Desktop.
Save nycdotnet/9173d4ebb61810831b02 to your computer and use it in GitHub Desktop.
Get releases info from GitHub API
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