Example #1
0
 public object GetParameter(string name)
 {
     CoreValidator.ThrowIfNullOrEmpty(name, nameof(name));
     return(this.sessionParameters.GetValueOrDefault(name, null));
 }
Example #2
0
        public HttpHandler(IServerRouteConfig routeConfig)
        {
            CoreValidator.ThrowIfNull(routeConfig, nameof(routeConfig));

            this.serverRouteConfig = routeConfig;
        }
Example #3
0
 public HttpResponse(HttpResponseStatusCode statusCode) : this()
 {
     CoreValidator.ThrowIfNull(statusCode, nameof(statusCode));
     this.StatusCode = statusCode;
 }
Example #4
0
 public HttpHeader GetHeader(string key)
 {
     CoreValidator.ThrowIfNullOrEmty(key, nameof(key));
     return(this.httpHeaders[key]);
 }
Example #5
0
 public void AddHeader(HttpHeader header)
 {
     CoreValidator.ThrowIfNull(header, nameof(header));
     this.Headers.Add(header);
 }
 public void Add(string key, object value)
 {
     CoreValidator.ThrowIfNullOrEmpty(key, nameof(key));
     CoreValidator.ThrowIfNull(value, nameof(value));
     this.values[key] = value;
 }
Example #7
0
        public bool ContainsParameter(string parameterName)
        {
            CoreValidator.ThrowIfNullOrEmpty(parameterName, nameof(parameterName));

            return(this.sessionParameters.ContainsKey(parameterName));
        }
Example #8
0
 public HttpCookie GetCookie(string key)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     return(this.cookies.GetValueOrDefault(key, null));
 }
        public HttpCookie Cookie(string key)
        {
            CoreValidator.ThrowIfNullOrEmpty(key, nameof(key));

            return(this.cookies[key]);
        }
Example #10
0
        public object GetParameter(string name)
        {
            CoreValidator.ThrowIfNullOrEmpty(name, nameof(name));

            return(this.sessionParameters[name]);
        }
Example #11
0
 public bool ContainsCookie(string key)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     return(this.cookies.ContainsKey(key));
 }
 public void AddCookie(HttpCookie httpCookie)
 {
     CoreValidator.ThrowIfNull(httpCookie, nameof(httpCookie));
     this.httpCookies.Add(httpCookie.Key, httpCookie);
 }
 private void ParseRequestUrl(string url)
 {
     CoreValidator.ThrowIfNullOrEmpty(url, nameof(url));
     this.Url = url;
 }
Example #14
0
 public void AddParameter(string name, object parameter)
 {
     CoreValidator.ThrowIfNullOrEmpty(name, nameof(name));
     CoreValidator.ThrowIfNull(parameter, nameof(parameter));
     this.sessionParameters.Add(name, parameter);
 }
Example #15
0
        public HttpContext(IHttpRequest request)
        {
            CoreValidator.ThrowIfNull(request, nameof(request));

            this.request = request;
        }
        public HttpContext(IHttpRequest httpRequest)
        {
            CoreValidator.ThrowIfNull(httpRequest, nameof(httpRequest));

            this.httpRequest = httpRequest;
        }
Example #17
0
 public RequestHandler(Func <IHttpRequest, IHttpResponse> handlingFunc)
 {
     CoreValidator.ThrowIfNull(handlingFunc, nameof(handlingFunc));
     this.handlingFunc = handlingFunc;
 }
Example #18
0
 public void Add(HttpHeader header)
 {
     CoreValidator.ThrowIfNull(header, nameof(header));
     this.headers[header.Key] = header;
 }
 public bool Containts(string key)
 {
     CoreValidator.ThrowIfNullOrEmpty(key, nameof(key));
     return(this.values.ContainsKey(key));
 }
Example #20
0
 public HttpHeader GetHeader(string key)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     return(this.headers.FirstOrDefault(h => h.Key == key).Value);
 }
Example #21
0
        private readonly IDictionary <string, object> values; //object is info for the session

        public HttpSession(string id)
        {
            CoreValidator.ThrowIfNullOrEmpty(id, nameof(id));
            this.Id     = id;
            this.values = new Dictionary <string, object>();
        }
Example #22
0
 protected RequestHandler(Func <IHttpContext, IHttpResponse> handlingFunc)
 {
     CoreValidator.ThrowIfNull(handlingFunc, nameof(handlingFunc));
     this.handlingFunc = handlingFunc;
 }
Example #23
0
        private bool IsValidRequestQueryString(string queryString, string[] queryParameters)
        {
            CoreValidator.ThrowIfNullOrEmpty(queryString, nameof(queryString));

            return(true); //TODO: REGEX QUERY STRING
        }
Example #24
0
        public HttpContext(string requestStr)
        {
            CoreValidator.ThrowIfNull(requestStr, nameof(requestStr));

            this.request = new HttpRequest(requestStr);
        }
Example #25
0
 public void AddCookie(HttpCookie cookie)
 {
     CoreValidator.ThrowIfNull(cookie, nameof(cookie));
     this.Cookies.Add(cookie);
 }
Example #26
0
        public RequestHandler(Func <IHttpRequest, IHttpResponse> func)
        {
            CoreValidator.ThrowIfNull(func, nameof(func));

            this.func = func;
        }
Example #27
0
        public bool ContainsKey(string key)
        {
            CoreValidator.ThrowIfNull(key, nameof(key));

            return(this.headers.ContainsKey(key));
        }
Example #28
0
 public void Add(string key, string value)
 {
     CoreValidator.ThrowIfNull(key, nameof(key));
     CoreValidator.ThrowIfNull(value, nameof(value));
     this.Add(new HttpCookie(key, value));
 }
Example #29
0
        public void Add(HttpCookie cookie)
        {
            CoreValidator.ThrowIfNull(cookie, nameof(cookie));

            this.cookies[cookie.Key] = cookie;
        }
Example #30
0
 public HttpSession(string id)
 {
     CoreValidator.ThrowIfNull(id, nameof(id));
     this.Id = id;
     this.sessionParameters = new Dictionary <string, object>();
 }