using Crestron.SimplSharp; using Crestron.SimplSharp.WebScripting; using Newtonsoft.Json; using PepperDash.Core; using PepperDash.Core.Web.RequestHandlers; namespace PepperDash.Essentials.Core.Web.RequestHandlers { public class LoadConfigRequestHandler : WebApiBaseRequestHandler { /// /// Constructor /// /// /// base(true) enables CORS support by default /// public LoadConfigRequestHandler() : base(true) { } /// /// Handles POST method requests /// /// protected override void HandlePost(HttpCwsContext context) { var message = ""; var cs = Global.ControlSystem as ILoadConfig; if(cs != null) cs.GoWithLoad(); context.Response.StatusCode = 200; context.Response.StatusDescription = "OK"; context.Response.Write(message, false); context.Response.End(); } } }