From cf73689e02fe85ab5419142ef658faee66507e89 Mon Sep 17 00:00:00 2001 From: Madpeter Date: Tue, 12 May 2020 00:10:11 +0100 Subject: [PATCH] getting started adding post support to web gui --- CLI/HttpWebUi/webui.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/CLI/HttpWebUi/webui.cs b/CLI/HttpWebUi/webui.cs index d5838f2..8acdca5 100644 --- a/CLI/HttpWebUi/webui.cs +++ b/CLI/HttpWebUi/webui.cs @@ -19,7 +19,22 @@ namespace BetterSecondBot.HttpWebUi bot = setbot; siteconfig = setconfig; } - public KeyValuePair process(List args,CookieCollection cookies) + public KeyValuePair Post_process(List args, Dictionary post_args) + { + if(args != null) + { + if(args.Count == 1) + { + if(args[0] == "ajax") + { + // webui only cares about ajax post requests + + } + } + } + return new KeyValuePair(false, ""); + } + public KeyValuePair Get_Process(List args,CookieCollection cookies) { Cookie logincookie = null; foreach(Cookie C in cookies) @@ -54,7 +69,7 @@ namespace BetterSecondBot.HttpWebUi } } } - return new KeyValuePair("text/html", Encoding.UTF8.GetBytes("")); + return new KeyValuePair("text/html", null); } } string layout = helpers.ReadResourceFile(Assembly.GetExecutingAssembly(), "full.layout"); @@ -71,7 +86,7 @@ namespace BetterSecondBot.HttpWebUi } else { - return new KeyValuePair("text/html", Encoding.UTF8.GetBytes("")); + return new KeyValuePair("text/html", null); } } }