예제 #1
0
        public async void Test_Default_Http_Get_Success()
        {
            var factory = ReturnHttpClientFactory();
            var client  = new DefaultHttpClient(factory);
            var r       = await client.GetAsync <string>("http://www.baidu.com", requestType : RequestType.QueryString);

            Assert.NotEmpty(r);
        }
예제 #2
0
        public override async Task ExecuteAsync(WorkloadContext context)
        {
            var response = await DefaultHttpClient.GetAsync(url, context.CancellationToken).ConfigureAwait(false);

            await ReadResponseAsync(response, context.CancellationToken).ConfigureAwait(false);
        }