示例#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;
 }
        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);
 }
        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;
 }