You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
894 B

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