Exemplo n.º 1
0
        internal static HttpResponse CreateCloseResponse(HttpStatusCode code)
        {
            var res = new HttpResponse(code);

            res.Headers["Connection"] = "close";

            return(res);
        }
Exemplo n.º 2
0
 internal HttpResponse(HttpStatusCode code, string reason)
     : this(((int)code).ToString(), reason, HttpVersion.Version11, new QueryParamCollection())
 {
     Headers["Server"] = "websocket-sharp/1.0";
 }
Exemplo n.º 3
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());
 }
Exemplo n.º 4
0
 internal HttpResponse(HttpStatusCode code)
     : this(code, code.GetDescription())
 {
 }
Exemplo n.º 5
0
 internal static void Close(this HttpListenerResponse response, HttpStatusCode code)
 {
     response.StatusCode = (int)code;
     response.OutputStream.Close();
 }