コード例 #1
0
 /// <summary>Creates a response from a status line.</summary>
 /// <remarks>
 /// Creates a response from a status line.
 /// The response will not have a reason phrase catalog and
 /// use the system default locale.
 /// </remarks>
 /// <param name="statusline">the status line</param>
 public BasicHttpResponse(StatusLine statusline) : base()
 {
     this.statusline    = Args.NotNull(statusline, "Status line");
     this.ver           = statusline.GetProtocolVersion();
     this.code          = statusline.GetStatusCode();
     this.reasonPhrase  = statusline.GetReasonPhrase();
     this.reasonCatalog = null;
     this.locale        = null;
 }
コード例 #2
0
 /// <summary>Creates a new response.</summary>
 /// <remarks>
 /// Creates a new response.
 /// This is the constructor to which all others map.
 /// </remarks>
 /// <param name="statusline">the status line</param>
 /// <param name="catalog">
 /// the reason phrase catalog, or
 /// <code>null</code> to disable automatic
 /// reason phrase lookup
 /// </param>
 /// <param name="locale">
 /// the locale for looking up reason phrases, or
 /// <code>null</code> for the system locale
 /// </param>
 public BasicHttpResponse(StatusLine statusline, ReasonPhraseCatalog catalog, CultureInfo
                          locale) : base()
 {
     this.statusline    = Args.NotNull(statusline, "Status line");
     this.ver           = statusline.GetProtocolVersion();
     this.code          = statusline.GetStatusCode();
     this.reasonPhrase  = statusline.GetReasonPhrase();
     this.reasonCatalog = catalog;
     this.locale        = locale;
 }
コード例 #3
0
 /// <summary>Creates a response from elements of a status line.</summary>
 /// <remarks>
 /// Creates a response from elements of a status line.
 /// The response will not have a reason phrase catalog and
 /// use the system default locale.
 /// </remarks>
 /// <param name="ver">the protocol version of the response</param>
 /// <param name="code">the status code of the response</param>
 /// <param name="reason">
 /// the reason phrase to the status code, or
 /// <code>null</code>
 /// </param>
 public BasicHttpResponse(ProtocolVersion ver, int code, string reason) : base()
 {
     Args.NotNegative(code, "Status code");
     this.statusline    = null;
     this.ver           = ver;
     this.code          = code;
     this.reasonPhrase  = reason;
     this.reasonCatalog = null;
     this.locale        = null;
 }
コード例 #4
0
 /// <summary>Creates a new response factory with the given catalog.</summary>
 /// <remarks>Creates a new response factory with the given catalog.</remarks>
 /// <param name="catalog">the catalog of reason phrases</param>
 public DefaultHttpResponseFactory(ReasonPhraseCatalog catalog)
 {
     this.reasonCatalog = Args.NotNull(catalog, "Reason phrase catalog");
 }