Created
June 13, 2015 14:29
-
-
Save shawnweisfeld/148b4c64d7d5e9dbc0da to your computer and use it in GitHub Desktop.
This file contains 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
static void Main(string[] args) | |
{ | |
var url = "http://localhost:60218/"; | |
while (true) | |
{ | |
try | |
{ | |
using (HttpClient client = new HttpClient()) | |
using (HttpResponseMessage response = client.GetAsync(url).Result) | |
using (HttpContent content = response.Content) | |
{ | |
Console.WriteLine(string.Format("{0:G} - {1}\n\n", DateTime.Now, content.ReadAsStringAsync().Result)); | |
} | |
} | |
catch (Exception ex) | |
{ | |
Console.WriteLine(ex.Message); | |
} | |
System.Threading.Thread.Sleep(500); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment