public async Task setup_scenario()
        {
            using (var webApi = new PingHttpApi())
                using (var httpClient = webApi.CreateClientWithRetrying(_callback, retries: ExpectedRetries, delayMs: 10))
                {
                    _eventUri = new Uri(webApi.BaseUri, "/ping").ToString();

                    _response = await httpClient.GetAsync("/ping");
                }
        }
Esempio n. 2
0
        public async Task setup_scenario()
        {
            using (var webApi = new PingHttpApi())
                using (var httpClient = webApi.CreateClientWithRetrying(_callback, retries: ExpectedRetries, delayMs: 10, timeoutMs: 10))
                {
                    _eventUri = new Uri(webApi.BaseUri, "/ping").ToString();

                    try
                    {
                        await httpClient.GetAsync("/ping");
                    }
                    catch (Exception e)
                    {
                        _exception = e;
                    }
                }
        }
Esempio n. 3
0
        public async Task setup_scenario()
        {
            using (var webApi = new PingHttpApi())
                using (var httpClient = webApi.CreateClientWithRetrying(_callback, retries: 1, delayMs: 10, timeoutMs: 100000))
                {
                    var message = new HttpRequestMessage(HttpMethod.Post, "/get-content");

                    message.Content = new StringContent("{\"contentA\":\"valueA\",\"contentB\":\"valueB\"}");
                    message.Content.Headers.Add("headerC", "valueC");
                    message.Content.Headers.Add("headerD", "valueD");

                    var response = await httpClient.SendAsync(message);

                    _content = await response.Content.ReadAsStringAsync();

                    Console.WriteLine(_content);
                }
        }