コード例 #1
0
        static void RequestOn(string serviceUri, IDiscoveryClient discoveryClient, int requestCount = 10)
        {
            var httpClient = new HttpClient(new PerRequestMessagehandler(new Uri(serviceUri), discoveryClient))
            {
                BaseAddress = discoveryClient.Discover(new Uri(serviceUri))
            };

            for(int i = 0; i < requestCount; i++)
            {
                var result = httpClient.GetStringAsync("Hello").Result;
                Logger.Info(string.Format("Result:{0}", result));
            }
        }