Skip to content

Instantly share code, notes, and snippets.

@shawnweisfeld
Created June 13, 2015 14:29
Show Gist options
  • Save shawnweisfeld/148b4c64d7d5e9dbc0da to your computer and use it in GitHub Desktop.
Save shawnweisfeld/148b4c64d7d5e9dbc0da to your computer and use it in GitHub Desktop.
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