Exemplo n.º 1
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="httpMethod">Method like <c>POST</c>.</param>
 /// <param name="pathAndQuery">Absolute path and query string (if one exist)</param>
 /// <param name="httpVersion">HTTP version like <c>HTTP/1.1</c></param>
 public HttpRequest(string httpMethod, string pathAndQuery, string httpVersion)
     : base(httpMethod, pathAndQuery, httpVersion)
 {
     Form = new ParameterCollection();
     Files = new HttpFileCollection();
     Cookies = new HttpCookieCollection();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Parse cookie string
        /// </summary>
        /// <returns>A generated cookie collection.</returns>
        public IHttpCookieCollection Parse(string value)
        {
            if (value == null) throw new ArgumentNullException("value");
            _headerValue = value;
            _cookies = new HttpCookieCollection();
            _parserMethod = Name_Before;

            while (!IsEOF)
            {
                _parserMethod();
            }

            OnCookie(_cookieName, _cookieValue);
            return (IHttpCookieCollection)_cookies;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpResponse"/> class.
 /// </summary>
 /// <param name="statusCode">The status code.</param>
 /// <param name="reasonPhrase">The reason phrase.</param>
 /// <param name="httpVersion">The HTTP version.</param>
 internal HttpResponse(int statusCode, string reasonPhrase, string httpVersion)
     : base(statusCode, reasonPhrase, httpVersion)
 {
     Cookies = new HttpCookieCollection();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HttpResponse"/> class.
 /// </summary>
 /// <param name="statusCode">The status code.</param>
 /// <param name="reasonPhrase">The reason phrase.</param>
 /// <param name="httpVersion">The HTTP version.</param>
 public HttpResponse(HttpStatusCode statusCode, string reasonPhrase, string httpVersion)
     : base(statusCode, reasonPhrase, httpVersion)
 {
     Cookies = new HttpCookieCollection();
 }