internal static HttpResponse CreateCloseResponse(HttpStatusCode code) { var res = new HttpResponse(code); res.Headers["Connection"] = "close"; return(res); }
internal HttpResponse(HttpStatusCode code, string reason) : this(((int)code).ToString(), reason, HttpVersion.Version11, new QueryParamCollection()) { Headers["Server"] = "websocket-sharp/1.0"; }
/// <summary> /// Gets the description of the specified HTTP status <paramref name="code"/>. /// </summary> /// <returns> /// A <see cref="string"/> that represents the description of the HTTP status code. /// </returns> /// <param name="code"> /// One of <see cref="HttpStatusCode"/> enum values, indicates the HTTP status codes. /// </param> public static string GetDescription(this HttpStatusCode code) { return(((int)code).GetStatusDescription()); }
internal HttpResponse(HttpStatusCode code) : this(code, code.GetDescription()) { }
internal static void Close(this HttpListenerResponse response, HttpStatusCode code) { response.StatusCode = (int)code; response.OutputStream.Close(); }