Exemplo n.º 1
0
        private static void DisplayResult(string url, string method, Task <string> task, Stopwatch w)
        {
            task.Wait();
            if (task.Result.Length <= 0)
            {
                throw new Exception("Response was empty.");
            }
            if (task.Exception != null)
            {
                throw task.Exception;
            }

            var substring = task.Result.Substring(0, Math.Min(task.Result.Length, 100));

            AnsiConsole.WriteLineGreen(GetMessage(url, w, method, substring));
        }