Ejemplo n.º 1
0
        protected Response(Version version, ResponseStatus status, Headers <ResponseHeader> headers, Body entity)
        {
            Version = version;
            Status  = status;
            var statusDescription = status.GetDescription();

            StatusCode = statusDescription.Substring(0, statusDescription.IndexOf(' '));
            Headers    = headers;
            Entity     = entity ?? Body.Empty;
            AddMissingContentLengthHeader();
        }
Ejemplo n.º 2
0
 public static Response Of(ResponseStatus statusCode, Headers <ResponseHeader> headers, Body entity)
 => new Response(Version.Http1_1, statusCode, headers, entity);
Ejemplo n.º 3
0
 public static Response Of(Version version, ResponseStatus statusCode, Headers <ResponseHeader> headers, Body entity)
 => new Response(version, statusCode, headers, entity);
Ejemplo n.º 4
0
 public static Response Of(Version version, ResponseStatus statusCode, Headers <ResponseHeader> headers, string entity)
 => new Response(version, statusCode, headers, Body.From(entity));
Ejemplo n.º 5
0
 public static Response Of(Version version, ResponseStatus statusCode, string entity)
 => new Response(version, statusCode, Http.Headers.Empty <ResponseHeader>(), Body.From(entity));
Ejemplo n.º 6
0
 public static Response Of(ResponseStatus statusCode, Body body)
 => new Response(Version.Http1_1, statusCode, Http.Headers.Empty <ResponseHeader>(), body);
Ejemplo n.º 7
0
 public static Response Of(ResponseStatus statusCode, Headers <ResponseHeader> headers, byte[] entity)
 => new Response(Version.Http1_1, statusCode, headers, Body.From(entity));
Ejemplo n.º 8
0
 public static Response Of(ResponseStatus statusCode, byte[] entity)
 => new Response(Version.Http1_1, statusCode, Http.Headers.Empty <ResponseHeader>(), Body.From(entity));