Example #1
0
 /// <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> >();
 }
Example #2
0
        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;
        }
Example #3
0
 internal Response(HttpListenerResponse response, ExpressConfiguration config)
 {
     _response = response;
     _config   = config;
 }