Created
October 28, 2012 22:01
-
-
Save prabirshrestha/3970089 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // 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); | |
| } | |
| } | |
| } |
This file contains hidden or 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
| 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