Beispiel #1
0
        public static void CallbackHandler(string stringifiedResponse)
        {
            VKLogger.Info("WebVKClient.CallbackHandler result = " + stringifiedResponse);

            APICallResponse acr = new APICallResponse();

            acr = JsonUtility.FromJson <APICallResponse>(stringifiedResponse);
            acr.responseJsonString = WWW.UnEscapeURL(acr.responseJsonString);

            callbackManager.HandleCallback(acr);
        }
        public void SendMail(Job job, APICallResponse processedResult)
        {
            // If you use mailService u need to customize

            LogService.Debug("Sending message to:" + "url");

            string Body = "Job Name : " + job.Name + "\r\n Response Type : " + Enum.GetName(typeof(ServiceResponseTypes), processedResult.Type) + "\r\n Response Message : " + processedResult.Message;

            RestClient client = new RestClient();

            client.BaseUrl       = new Uri("x");
            client.Authenticator = new HttpBasicAuthenticator("api", ConfigurationManager.AppSettings["mailPassword"]);
            RestRequest request = new RestRequest();

            request.Credentials = new NetworkCredential("api", ConfigurationManager.AppSettings["mailPassword"]).GetCredential(client.BaseUrl, "Basic");
            request.AddParameter("from", "*****@*****.**");
            request.AddParameter("to", "*****@*****.**");
            request.AddParameter("subject", "Scheduler Info Message");
            request.AddParameter("text", Body);
            request.Method   = Method.POST;
            request.Resource = "messages";
            request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
            client.Post(request);
        }