-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIWebResponse.cs
74 lines (62 loc) · 1.89 KB
/
IWebResponse.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System.IO;
namespace Inversion.Web {
/// <summary>
/// Describes a response from a web application.
/// </summary>
public interface IWebResponse {
/// <summary>
/// The text writer used for writing to the response stream.
/// </summary>
TextWriter Output { get; }
/// <summary>
/// The response stream.
/// </summary>
Stream OutputStream { get; }
/// <summary>
/// The status code of the response.
/// </summary>
int StatusCode { get; set; }
/// <summary>
/// The status description of the response stream.
/// </summary>
string StatusDescription { get; set; }
/// <summary>
/// The content type of the response stream.
/// </summary>
string ContentType { get; set; }
/// <summary>
/// Access to the response cookies.
/// </summary>
IResponseCookieCollection Cookies { get; }
/// <summary>
/// Access to the response headers.
/// </summary>
IResponseHeaderCollection Headers { get; }
/// <summary>
/// Flushes the response steam and ends the response.
/// </summary>
void End();
/// <summary>
/// Writes the provided text to the response stream.
/// </summary>
/// <param name="text">The text to write to the response stream.</param>
void Write(string text);
/// <summary>
/// Writes the provided formatted text to the response stream.
/// </summary>
/// <param name="text">The text to write to the response stream.</param>
/// <param name="args">The arguments to interpolate into the text.</param>
void WriteFormat(string text, params object[] args);
/// <summary>
/// Redirects the request to the provided url.
/// </summary>
/// <param name="url">The url to redirect to.</param>
void Redirect(string url);
/// <summary>
/// Redirects the request permanently to the provided url
/// issuing a `301` in the response.
/// </summary>
/// <param name="url"></param>
void PermanentRedirect(string url);
}
}