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)); }
/// <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; }
/// <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); }