1 #if !SILVERLIGHT && !XBOX
2 using System;
3 using System.Collections.Generic;
4 using System.Collections.Specialized;
5 using System.IO;
6 using System.Net;
7 
8 namespace ServiceStack.ServiceHost
9 {
10 	/// <summary>
11 	/// A thin wrapper around ASP.NET or HttpListener's HttpRequest
12 	/// </summary>
13 	public interface IHttpRequest : IResolver
14 	{
15 		/// <summary>
16 		/// The underlying ASP.NET or HttpListener HttpRequest
17 		/// </summary>
18 		object OriginalRequest { get; }
19 
20 		/// <summary>
21 		/// The name of the service being called (e.g. Request DTO Name)
22 		/// </summary>
23 		string OperationName { get; }
24 
25 		/// <summary>
26 		/// The request ContentType
27 		/// </summary>
28 		string ContentType { get; }
29 
30 		string HttpMethod { get; }
31 
32 		string UserAgent { get; }
33 
34 		IDictionary<string, System.Net.Cookie> Cookies { get; }
35 
36 		/// <summary>
37 		/// The expected Response ContentType for this request
38 		/// </summary>
39 		string ResponseContentType { get; set; }
40 
41 		/// <summary>
42 		/// Attach any data to this request that all filters and services can access.
43 		/// </summary>
44 		Dictionary<string, object> Items { get; }
45 
46 		NameValueCollection Headers { get; }
47 
48 		NameValueCollection QueryString { get; }
49 
50 		NameValueCollection FormData { get; }
51 
52 		/// <summary>
53 		/// The entire string contents of Request.InputStream
54 		/// </summary>
55 		/// <returns></returns>
GetRawBody()56 		string GetRawBody();
57 
58 		string RawUrl { get; }
59 
60 		string AbsoluteUri { get; }
61 
62         /// <summary>
63         /// The Remote Ip as reported by Request.UserHostAddress
64         /// </summary>
65         string UserHostAddress { get; }
66 
67         /// <summary>
68         /// The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress
69         /// </summary>
70         string RemoteIp { get; }
71 
72 		/// <summary>
73 		/// e.g. is https or not
74 		/// </summary>
75 		bool IsSecureConnection { get; }
76 
77 		string[] AcceptTypes { get; }
78 
79 		string PathInfo { get; }
80 
81 		Stream InputStream { get; }
82 
83 		long ContentLength { get; }
84 
85 		/// <summary>
86 		/// Access to the multi-part/formdata files posted on this request
87 		/// </summary>
88 		IFile[] Files { get; }
89 
90 		string ApplicationFilePath { get; }
91 	}
92 }
93 #endif
94