Пример #1
0
        /// <summary>
        /// Constructs a HTTP 1.1 response.
        /// </summary>
        /// <param name="status">HTTP response status code.</param>
        /// <remarks>
        /// The reason phrase will be initialized to the standard phrase
        /// from HttpStack.GetReasonPhrase().
        /// </remarks>
        public HttpResponse(HttpStatus status)
            : base(status, HttpStack.GetReasonPhrase(status))
        {
            this.parseState = ParseState.Disabled;

            if (content == null)
            {
                content = new BlockArray();
            }
        }
Пример #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="status">The <see cref="HttpStatus" /> code.</param>
 public HttpException(HttpStatus status)
     : base(string.Format("HTTP Error [{0}={1}].", HttpStack.GetReasonPhrase(status), (int)status))
 {
 }