forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIHttpResponse.cs
More file actions
55 lines (41 loc) · 1.52 KB
/
IHttpResponse.cs
File metadata and controls
55 lines (41 loc) · 1.52 KB
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
using System.IO;
namespace ServiceStack.Web
{
/// <summary>
/// A thin wrapper around ASP.NET or HttpListener's HttpResponse
/// </summary>
public interface IHttpResponse
{
/// <summary>
/// The underlying ASP.NET or HttpListener HttpResponse
/// </summary>
object OriginalResponse { get; }
int StatusCode { get; set; }
string StatusDescription { get; set; }
string ContentType { get; set; }
ICookies Cookies { get; }
void AddHeader(string name, string value);
void Redirect(string url);
Stream OutputStream { get; }
void Write(string text);
/// <summary>
/// Signal that this response has been handled and no more processing should be done.
/// When used in a request or response filter, no more filters or processing is done on this request.
/// </summary>
void Close();
/// <summary>
/// Calls Response.End() on ASP.NET HttpResponse otherwise is an alias for Close().
/// Useful when you want to prevent ASP.NET to provide it's own custom error page.
/// </summary>
void End();
/// <summary>
/// Response.Flush() and OutputStream.Flush() seem to have different behaviour in ASP.NET
/// </summary>
void Flush();
/// <summary>
/// Gets a value indicating whether this instance is closed.
/// </summary>
bool IsClosed { get; }
void SetContentLength(long contentLength);
}
}