Esempio n. 1
0
        public void Add(string key, object value)
        {
            MyValidator.ThrowIfNullOrEmpty(key, nameof(key));
            MyValidator.ThrowIfNull(value, nameof(value));

            this.values[key] = value;
        }
Esempio n. 2
0
        public void Add(string key, string value)
        {
            MyValidator.ThrowIfNullOrEmpty(key, nameof(key));
            MyValidator.ThrowIfNullOrEmpty(value, nameof(value));

            this.Add(new HttpCookie(key, value));
        }
Esempio n. 3
0
        public HttpSession(string id)
        {
            MyValidator.ThrowIfNullOrEmpty(id, nameof(id));

            this.Id     = id;
            this.values = new Dictionary <string, object>();
        }
Esempio n. 4
0
        public void AddUrlParameter(string key, string value)
        {
            MyValidator.ThrowIfNullOrEmpty(key, nameof(key));
            MyValidator.ThrowIfNullOrEmpty(value, nameof(value));

            this.UrlParameters[key] = value;
        }
Esempio n. 5
0
        public HttpHeader(string key, string value)
        {
            MyValidator.ThrowIfNullOrEmpty(key, nameof(key));
            MyValidator.ThrowIfNullOrEmpty(value, nameof(value));

            this.Key   = key;
            this.Value = value;
        }
Esempio n. 6
0
        public HttpCookie(string key, string value, int expires = 3)
        {
            MyValidator.ThrowIfNullOrEmpty(key, nameof(key));
            MyValidator.ThrowIfNullOrEmpty(value, nameof(value));

            this.Key   = key;
            this.Value = value;

            this.Expires = DateTime.UtcNow.AddDays(expires);
        }
Esempio n. 7
0
        public HttpRequest(string requestText)
        {
            MyValidator.ThrowIfNullOrEmpty(requestText, nameof(requestText));
            this.requestText = requestText;

            this.requestText = requestText;

            this.FormData      = new Dictionary <string, string>();
            this.UrlParameters = new Dictionary <string, string>();
            this.Headers       = new HttpHeaderCollection();
            this.Cookies       = new HttpCookieCollection();

            this.ParseRequest(requestText);
        }
Esempio n. 8
0
        public RedirectResponse(string redirectUrl)
        {
            MyValidator.ThrowIfNullOrEmpty(redirectUrl, nameof(redirectUrl));

            this.StatusCode = HttpStatusCode.Found;