예제 #1
0
 public void Add(HttpHeader header)
 {
     CoreValidator.ThrowIfNull(header, nameof(header));
     this.headers.Add(header.Key, header);
 }
예제 #2
0
        public HttpContext(IHttpRequest requestString)
        {
            CoreValidator.ThrowIfNull(requestString, nameof(requestString));

            request = requestString;
        }
예제 #3
0
 public void AddCookie(HttpCookie cookie)
 {
     CoreValidator.ThrowIfNull(cookie, nameof(cookie));
     this.Cookies.AddCookie(cookie);
 }
 public HttpHeader GetHeader(string key)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     return(this.headers.GetValueOrDefault(key, null));
 }
예제 #5
0
        public RequestHandler(Func <IHttpRequest, IHttpResponse> handlingFunc)
        {
            CoreValidator.ThrowIfNull(handlingFunc, nameof(handlingFunc));

            this.handlingFunc = handlingFunc;
        }
        public bool ContainsKey(string key)
        {
            CoreValidator.ThrowIfNull(key, nameof(key));

            return(this.cookies.ContainsKey(key));
        }
예제 #7
0
        public RequestHandler(Func <IHttpRequest, IHttpResponse> func)
        {
            CoreValidator.ThrowIfNull(func, nameof(func));

            this.func = func;
        }
예제 #8
0
 public void AddParameter(string name, object parameter)
 {
     CoreValidator.ThrowIfNullOrEmpty(name, nameof(name));
     CoreValidator.ThrowIfNull(parameter, nameof(parameter));
     this.sessionParameters.Add(name, parameter);
 }
예제 #9
0
 public Func <IHttpRequest, IHttpResponse> Get(HttpRequestMethod method, string path)
 {
     CoreValidator.ThrowIfNull(method, nameof(method));
     CoreValidator.ThrowIfNullOrEmpty(path, nameof(path));
     return(this.routingTable[method][path]);
 }
예제 #10
0
 public void AddParametar(string name, object parametar)
 {
     CoreValidator.ThrowIfNullOrEmpty(name, nameof(name));
     CoreValidator.ThrowIfNull(parametar, nameof(parametar));
     this.sessionParametars[name] = parametar;
 }
 protected RequestHandler(Func <IHttpContext, IHttpResponse> handlingFunc)
 {
     CoreValidator.ThrowIfNull(handlingFunc, nameof(handlingFunc));
     this.handlingFunc = handlingFunc;
 }
예제 #12
0
 public HttpCookie GetCookie(string key)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     return(this.cookies.FirstOrDefault(c => c.Key == key).Value);
 }
        public HttpContext(string requestStr)
        {
            CoreValidator.ThrowIfNull(requestStr, nameof(requestStr));

            this.request = new HttpRequest(requestStr);
        }
 public void Add(IHttpCookie cookie)
 {
     CoreValidator.ThrowIfNull(cookie, nameof(cookie.Key));
     this.cookies.Add(cookie.Key, cookie);
 }
        public HttpContext(IHttpRequest httpRequest)
        {
            CoreValidator.ThrowIfNull(httpRequest, nameof(httpRequest));

            this.httpRequest = httpRequest;
        }
예제 #16
0
 public HttpSession(string id)
 {
     CoreValidator.ThrowIfNull(id, nameof(id));
     this.Id = id;
     this.sessionParameters = new Dictionary <string, object>();
 }
예제 #17
0
        public bool ContainsKey(string key)
        {
            CoreValidator.ThrowIfNull(key, nameof(key));

            return(this.headers.Any(h => h.Key == key));
        }
        public void Add(HttpCookie httpCookie)
        {
            CoreValidator.ThrowIfNull(httpCookie, nameof(httpCookie));

            this.httpCookies[httpCookie.Key] = httpCookie;
        }
 public void Add(HttpHeader header)
 {
     CoreValidator.ThrowIfNull(header, nameof(header));
     headers[header.Key] = header;
 }
예제 #20
0
        public HttpHandler(IServerRouteConfig routeConfig)
        {
            CoreValidator.ThrowIfNull(routeConfig, nameof(routeConfig));

            this.serverRouteConfig = routeConfig;
        }
예제 #21
0
        public void AddCookie(HttpCookie cookie)
        {
            CoreValidator.ThrowIfNull(httpCookies, nameof(cookie));

            this.httpCookies.Add(cookie.Key, cookie);
        }
예제 #22
0
 public HttpResponse(HttpResponseStatusCode statusCode) : this()
 {
     CoreValidator.ThrowIfNull(statusCode, nameof(statusCode));
     this.StatusCode = statusCode;
 }
예제 #23
0
        public void AddCookie(HttpCookie cookie)
        {
            CoreValidator.ThrowIfNull(cookie, nameof(cookie));

            this.CookieColection.Add(cookie.Key, cookie);
        }
예제 #24
0
 public void AddHeader(HttpHeader header)
 {
     CoreValidator.ThrowIfNull(header, nameof(header));
     this.Headers.AddHeader(header);
 }
예제 #25
0
        public HttpContext(IHttpRequest request)
        {
            CoreValidator.ThrowIfNull(request, nameof(request));

            this.request = request;
        }
예제 #26
0
        public void Add(HttpCookie cookie)
        {
            CoreValidator.ThrowIfNull(cookie, nameof(cookie));

            this.cookies[cookie.Key] = cookie;
        }
 public HttpCookie GetCookie(string key)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     return(this.cookies.GetValueOrDefault(key, null));
 }
예제 #28
0
 public bool ContainsHeader(string key)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     return(this.headers.ContainsKey(key));
 }
예제 #29
0
 public RequestHandler(Func <IHttpRequest, IHttpResponse> f)
 {
     CoreValidator.ThrowIfNull(f, nameof(f));
     _f = f;
 }