Esempio n. 1
0
        //NOTE: id is zip code in this scenario
        public async Task <T> Get <T>(string id)
        {
            if (string.IsNullOrEmpty(id))
            {
                throw new ArgumentNullException(nameof(id), "Zip cannot be null or empty");
            }

            Uri uri = uriHelper.CreateUri(baseUrl, UrlConstants.Rates, id);

            HttpResponseMessage response = await taxRateHttpClient.Client.GetAsync(uri);

            string responseContent = await response.Content.ReadAsStringAsync();

            return(JsonConvert.DeserializeObject <T>(responseContent));
        }