Example #1
0
        private async static Task <HttpResponseMessage> GetAsync(string url)
        {
            ITrHttpClientFactory factory = new TrHttpClientFactory();
            var client = factory.CreateHttpClient();

            return(await client.GetAsync(url));
        }
Example #2
0
        private async static Task <HttpResponseMessage> PostAsync(string url, string postStr, string contentType = "application/json")
        {
            ITrHttpClientFactory factory = new TrHttpClientFactory();
            var client = factory.CreateHttpClient();

            return(await client.PostAsync(url, postStr, contentType));
        }