Ejemplo n.º 1
0
 public static AuthorizationCore GetInstance()
 {
     if (instance == null)
     {
         lock (syncRoot)
         {
             instance = new AuthorizationCore();
         }
     }
     return(instance);
 }
Ejemplo n.º 2
0
        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);
            }
        }