Exemplo n.º 1
0
        public async Task <Models.GetAddress.Response> GetAddressAsync(Models.GetAddress.Request request)
        {
            String        json           = JsonConvert.SerializeObject(request);
            StringContent requestContent = new StringContent(json, Encoding.UTF8, MEDIA_TYPE);
            String        url            = String.Format("{0}", _host);

            String response = await Post(requestContent, url);

            return(JsonConvert.DeserializeObject <Models.GetAddress.Response>(response));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get a HD address
        /// </summary>
        /// <param name="id">Request id</param>
        /// <returns></returns>
        public async Task<Models.GetAddress.Response> GetAddressAsync(String id)
        {
            System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();

            Models.GetAddress.Request request = new Models.GetAddress.Request() { Id = id };
            String json = JsonConvert.SerializeObject(request);
            StringContent requestContent = new StringContent(json, Encoding.UTF8, MEDIA_TYPE);
            String url = String.Format("{0}", _host);

            String content = await Post(requestContent, url);
            var response = JsonConvert.DeserializeObject<Models.GetAddress.Response>(content);

            sw.Start();
            response.Elapsed = sw.Elapsed;
            return response;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Get a HD address
        /// </summary>
        /// <param name="id">Request id</param>
        /// <returns></returns>
        public async Task <Models.GetAddress.Response> GetAddressAsync(String id)
        {
            System.Diagnostics.Stopwatch sw = System.Diagnostics.Stopwatch.StartNew();

            Models.GetAddress.Request request = new Models.GetAddress.Request()
            {
                Id = id
            };
            String        json           = JsonConvert.SerializeObject(request);
            StringContent requestContent = new StringContent(json, Encoding.UTF8, MEDIA_TYPE);
            String        url            = String.Format("{0}", _host);

            String content = await Post(requestContent, url);

            var response = JsonConvert.DeserializeObject <Models.GetAddress.Response>(content);

            sw.Start();
            response.Elapsed = sw.Elapsed;
            return(response);
        }