using JMETxnPushScheduler.Business; using System; using System.Net.Http; using System.Net.Http.Headers; namespace JMETxnPushScheduler.API { public class RestApiClient { private static int timeOut = 100;//Convert.ToInt16(ConfigurationManager.AppSettings["ApiTimeOutSeconds"]); public static HttpClient CallJMEThirdParty() { string thirdPartyUrl = GetStatic.ReadWebConfig("JMECoreAPIURL", ""); var httpClient = new HttpClient(); httpClient.BaseAddress = new Uri(thirdPartyUrl); httpClient.DefaultRequestHeaders.Add("apiAccessKey", GetStatic.ReadWebConfig("JMECoreAPI_HeaderToken", "")); httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); httpClient.Timeout = new TimeSpan(0, 0, timeOut); return httpClient; } } }