aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Net/Response.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Net/Response.cs')
-rw-r--r--MediaBrowser.Controller/Net/Response.cs49
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