Ejemplo n.º 1
0
        void IHttpMessage.AddField(HttpField field)
        {
            switch (field.Name)
            {
            case HttpConst.ContentType:
                ContentType = field.Value;
                break;

            case HttpConst.ContentLength:
                ContentLength = int.Parse(field.Value);
                break;

            case HttpConst.Server:
                Server = field.Value;
                break;

            case HttpConst.Location:
                Location = field.Value;
                break;

            case HttpConst.TransferEncoding:
                TransferEncoding = (TransferEncodings)Enum.Parse(
                    typeof(TransferEncodings),
                    field.Value, true);
                break;

            default:
                break;
            }

            Head.AddField(field);
        }