1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.Framework
20 public interface IResponse
22 int StatusCode { get; set; }
24 String ContentType { get; set; }
27 /// Gets the caching policy (expiration time, privacy,
28 /// vary clauses) of a Web page.
30 HttpCachePolicy CachePolicy { get; }
33 /// Sets the Cache-Control HTTP header to Public or Private.
35 String CacheControlHeader { get; set; }
38 /// Gets or sets the HTTP character set of the output stream.
40 String Charset { get; set; }
42 System
.IO
.TextWriter Output { get; }
44 System
.IO
.Stream OutputStream { get; }
46 void AppendHeader(String name
, String
value);
48 void BinaryWrite(byte[] buffer
);
50 void BinaryWrite(System
.IO
.Stream stream
);
58 void Write(object obj
);
62 void Write(char[] buffer
, int index
, int count
);
64 void WriteFile(String fileName
);
66 void Redirect(String controller
, String action
);
68 void Redirect(String area
, String controller
, String action
);
70 void Redirect(String url
);
72 void Redirect(String url
, bool endProcess
);
74 bool WasRedirected { get; }
76 bool IsClientConnected { get; }
78 void CreateCookie(String name
, String
value);
80 void CreateCookie(String name
, String
value, DateTime expiration
);
82 void CreateCookie(HttpCookie cookie
);
84 void RemoveCookie(string name
);