Skip to content

Instantly share code, notes, and snippets.

@gamemachine
Last active December 26, 2015 07:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gamemachine/7113668 to your computer and use it in GitHub Desktop.
Save gamemachine/7113668 to your computer and use it in GitHub Desktop.
using System.Net;
using System.Net.Sockets;
using System;
using System.Text;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
public class Client
{
public static void Main (string[] args)
{
for (int i = 1; i <= 50; i++)
{
Test ();
}
}
public static void Test ()
{
using (var client = new HttpClient()) {
var response = client.GetAsync ("http://127.0.0.1/doc/index.html");
if (response.Result.IsSuccessStatusCode) {
var responseContent = response.Result.Content;
string responseString = responseContent.ReadAsStringAsync ().Result;
Console.WriteLine (responseString);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment