Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Created October 28, 2012 22:01
Show Gist options
  • Save prabirshrestha/3970089 to your computer and use it in GitHub Desktop.
Save prabirshrestha/3970089 to your computer and use it in GitHub Desktop.
// install-package httphelper -pre
// install-package simplejson
#define SIMPLE_JSON_DYNAMIC
public static object Get(string url)
{
var httpHelper = new HttpHelper(url);
using (var stream = httpHelper.OpenRead())
{
using (var reader = new StreamReader(stream))
{
var json = reader.ReadToEnd();
return SimpleJson.DeserializeObject(json);
}
}
}
dynamic result = Get("https://api.github.com/repos");
var id = result.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment