Пример #1
0
 public Response(Code C, IStreamableContent body)
 {
     httpCode      = C;
     this.httpBody = body;
     this.AddInstruction(new Instruction("Server", "Sabertooth"));
     this.AddInstruction(new Instruction("Date", DateTime.Now.ToString("R")));
 }
Пример #2
0
        protected bool SaveFile(string urlpath, IStreamableContent isc)
        {
            string fullpath = Path.Combine(AssetSubdir, urlpath);

            if (File.Exists(fullpath))
            {
                return(false);
            }
            else
            {
                using (FileStream FS = File.Create(fullpath)) {
                    isc.StreamTo(FS);
                }
                return(true);
            }
        }
Пример #3
0
 public ClientReturn(IStreamableContent body)
 {
     this.body = body;
 }
Пример #4
0
 public void SetBody(IStreamableContent ICS)
 {
     this.httpBody = ICS;
 }
Пример #5
0
 public void SetBody(byte[] B, MIME M)
 {
     this.httpBody = new GeneratedResource(B, M);
 }