diff options
| author | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-07-12 02:55:27 -0400 |
|---|---|---|
| committer | LukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com> | 2012-07-12 02:55:27 -0400 |
| commit | b50f78e5da6f3fdfc59e577ca61b88771da7d211 (patch) | |
| tree | 644ba93dc04bb8837a19a9cd5c3dfa8c6d62a91d /MediaBrowser.Controller/Net/Response.cs | |
Initial check-in
Diffstat (limited to 'MediaBrowser.Controller/Net/Response.cs')
| -rw-r--r-- | MediaBrowser.Controller/Net/Response.cs | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Net/Response.cs b/MediaBrowser.Controller/Net/Response.cs new file mode 100644 index 000000000..a119198cb --- /dev/null +++ b/MediaBrowser.Controller/Net/Response.cs @@ -0,0 +1,49 @@ +using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace MediaBrowser.Controller.Net
+{
+ public class Response
+ {
+ protected RequestContext RequestContext { get; private set; }
+
+ public Response(RequestContext ctx)
+ {
+ RequestContext = ctx;
+
+ WriteStream = s => { };
+ StatusCode = 200;
+ Headers = new Dictionary<string, string>();
+ CacheDuration = TimeSpan.FromTicks(0);
+ ContentType = "text/html";
+ }
+
+ public int StatusCode { get; set; }
+ public string ContentType { get; set; }
+ public IDictionary<string, string> Headers { get; set; }
+ public TimeSpan CacheDuration { get; set; }
+ public Action<Stream> WriteStream { get; set; }
+ }
+
+ /*public class ByteResponse : Response
+ {
+ public ByteResponse(byte[] bytes)
+ {
+ WriteStream = async s =>
+ {
+ await s.WriteAsync(bytes, 0, bytes.Length);
+ s.Close();
+ };
+ }
+ }
+
+ public class StringResponse : ByteResponse
+ {
+ public StringResponse(string message)
+ : base(Encoding.UTF8.GetBytes(message))
+ {
+ }
+ }*/
+}
\ No newline at end of file |
