- If the controller cannot be found, MR searches for a special rescue "rescues/404...
[castle.git] / MonoRail / Castle.MonoRail.Framework / IResponse.cs
blob4577c9efdba4c2dc271844beb71698bdceeb2f2b
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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
17 using System;
18 using System.Web;
20 public interface IResponse
22 int StatusCode { get; set; }
24 String ContentType { get; set; }
26 /// <summary>
27 /// Gets the caching policy (expiration time, privacy,
28 /// vary clauses) of a Web page.
29 /// </summary>
30 HttpCachePolicy CachePolicy { get; }
32 /// <summary>
33 /// Sets the Cache-Control HTTP header to Public or Private.
34 /// </summary>
35 String CacheControlHeader { get; set; }
37 /// <summary>
38 /// Gets or sets the HTTP character set of the output stream.
39 /// </summary>
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);
52 void Clear();
54 void ClearContent();
56 void Write(String s);
58 void Write(object obj);
60 void Write(char ch);
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);