/// <summary> /// Instantiatior for ExpressSharp Application /// </summary> public Express() { if (!HttpListener.IsSupported) { throw new UnsupportedOperatingSystemException(); } _config = new ExpressConfiguration(); _config.server = new HttpListener(); _config.actions = new List <Action <Request, Response, Action> >(); _config.bindings = new Dictionary <string, Action <Request, Response> >(); }
internal Request(HttpListenerRequest request, ExpressConfiguration config) { _request = request; if (!request.HasEntityBody) { return; } string body = StringFromStream(request.InputStream); this.Header = new HeaderHandler(_request); this.Body = body; }
internal Response(HttpListenerResponse response, ExpressConfiguration config) { _response = response; _config = config; }