Exemple #1
0
        private static void RunSyncTests()
        {
            var httpCaller = new HTTPCaller(@"http://jsonplaceholder.typicode.com");

            httpCaller.CallApiStringAsync("/posts").Wait();
            httpCaller.CallApiStringAsync("/photos").Wait();
            httpCaller.CallApiStringAsync("/comments").Wait();
            httpCaller.CallApiStringAsync("/todos").Wait();
        }
Exemple #2
0
        private static void RunAsyncTests()
        {
            var httpCaller = new HTTPCaller(@"http://jsonplaceholder.typicode.com");

            var apiCall1 = httpCaller.CallApiStringAsync("/posts");
            var apiCall2 = httpCaller.CallApiStringAsync("/photos");
            var apiCall3 = httpCaller.CallApiStringAsync("/comments");
            var apiCall4 = httpCaller.CallApiStringAsync("/todos");

            Task.WaitAll(apiCall1, apiCall2, apiCall3, apiCall4);
        }