Created
June 12, 2014 17:56
-
-
Save Redth/03638f20639c7e513ccb 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
| var http = new HttpClient (); | |
| // This is sorta node.js like with a 'callback' or continuation after the async operation completes: | |
| http.GetStringAsync ("https://google.com") | |
| .ContinueWith (t => { | |
| var html = t.Result; | |
| Console.WriteLine (html); | |
| }); | |
| // This is the same thing: | |
| var html = await http.GetStringAsync ("https://google.com"); | |
| Console.WriteLine (html); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment