public HttpResponseMessage CallPensionDetail(string aadhar) { PensionDetailCall banktype = new PensionDetailCall(); ClientInput res = new ClientInput(); HttpResponseMessage response = new HttpResponseMessage(); using (var client = new HttpClient()) { client.BaseAddress = new Uri("https://localhost:44341/"); client.DefaultRequestHeaders.Clear(); client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); try { response = client.GetAsync("api/PensionerDetail/" + aadhar).Result; } catch (Exception e) { response = null; } } return(response); }
/// <summary> /// Calling the Pension Detail Microservice /// </summary> /// <param name="aadhar"></param> /// <returns>value for calculations and client input</returns> public HttpResponseMessage PensionDetail(string aadhar) { PensionDetailCall banktype = new PensionDetailCall(configuration); ProcessPensionInput res = new ProcessPensionInput(); HttpResponseMessage response = new HttpResponseMessage(); string uriConn = configuration.GetValue <string>("MyUriLink:UriLink"); using (var client = new HttpClient()) { client.BaseAddress = new Uri(uriConn); client.DefaultRequestHeaders.Clear(); client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); try { response = client.GetAsync("api/PensionerDetail/" + aadhar).Result; } catch (Exception e) { _log4net.Error("Exception Occured" + e); return(null); } } return(response); }