Created
May 1, 2012 02:31
-
-
Save peteraritchie/2564547 to your computer and use it in GitHub Desktop.
async GetResponse C# 5
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
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://www.microsoft.com/en/us/default.aspx"); | |
HttpWebResponse webResponse = (HttpWebResponse)await webRequest.GetResponseAsync(); | |
Trace.WriteLine(webResponse.StatusCode); | |
webRequest = (HttpWebRequest)WebRequest.Create("http://google.ca"); | |
webResponse = (HttpWebResponse)await webRequest.GetResponseAsync(); | |
Trace.WriteLine(webResponse.StatusCode); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment