Result IPage.Get(Request request) { Result r = new Result(); r.Body = file; return r; }
Result IPage.Post(Request request) { return generator.Post(request); }
Result IPage.Get(Request request) { return generator.Get(request); }
private static void OnRequest(Request r, HTTPConnection.RequestCompleteHandler callback) { IPage p; if (! pages.TryGetValue(r.URI, out p)) { p = specials[HTTPCode.NotFound]; callback(p.Get(r)); } var res = p.Get(r); if (res.Keep_Alive == null) { res.Keep_Alive = r.Keep_Alive; // Unless the page specifically accepted or denied keeping the connection open, go with what the client asked. } foreach (var c in res.cookies) { if (c.Path == null) { c.Path = p.GetPath(); // Set the cookie's path if it wasn't specified. } CookieManager.AddCookie(c); } callback(res); }
public override HTMLComponent Get(Request request) { return new TextComponent(Encoding.UTF8.GetString(File.ReadAllBytes(Path))); }
private static void OnRequest(Request r, HTTPConnection.RequestCompleteHandler callback) { Page p; if (! pages.TryGetValue(r.URI, out p)) { p = specials[HTTPCode.NotFound]; } callback(p.Get(r)); }
Result IPage.Post(Request request) { return null; }