public static AuthorizationCore GetInstance() { if (instance == null) { lock (syncRoot) { instance = new AuthorizationCore(); } } return(instance); }
public static string PostData(HttpRequestMessage aInRequest, string aInBackendUrl, string aInData) { Logger.Writeline("POST API Url {0} body {1}", aInBackendUrl, aInData); try { List <KeyValuePair <string, string> > aInHeaders = new List <KeyValuePair <string, string> >(); AuthorizationCore.Instance.GetDuploUserHeader(aInHeaders); return(Utils.PostData <string>(aInBackendUrl, aInData, true, aInHeaders, string.Empty)); } catch (Exception ex) { Logger.Writeline("POST failed {0}", ex.Message); throw AuthorizationCore.ThrowResponseException(aInRequest, HttpStatusCode.BadRequest, ex.Message); } }