1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.Framework
18 using System
.Collections
;
19 using System
.Collections
.Specialized
;
23 /// Represents the request data
25 public interface IRequest
28 /// Gets the Http headers.
30 /// <value>The Http headers.</value>
31 NameValueCollection Headers { get; }
34 /// Gets the <see cref="HttpPostedFile"/> per key.
36 IDictionary Files { get; }
39 /// Gets the params which accumulates headers, post, querystring and cookies.
41 /// <value>The params.</value>
42 NameValueCollection Params { get; }
45 /// Gets a value indicating whether this requeest is from a local address.
47 /// <value><c>true</c> if this instance is local; otherwise, <c>false</c>.</value>
51 /// Gets additional path information for
52 /// a resource with a URL extension.
54 /// <value>The path info.</value>
55 String PathInfo { get; }
60 /// <value>The raw URL.</value>
61 String RawUrl { get; }
66 /// <value>The URI.</value>
70 /// Gets the HTTP method.
72 /// <value>The HTTP method.</value>
73 String HttpMethod { get; }
76 /// Gets the file path.
78 /// <value>The file path.</value>
79 String FilePath { get; }
82 /// Reads the request data as a byte array.
84 /// <param name="count">How many bytes.</param>
85 /// <returns></returns>
86 byte[] BinaryRead(int count
);
89 /// Gets the param with the specified key.
92 String
this [String key
] { get; }
97 /// <param name="name">The cookie name.</param>
98 /// <returns></returns>
99 String
ReadCookie( String name
);
102 /// Gets the query string.
104 /// <value>The query string.</value>
105 NameValueCollection QueryString { get; }
110 /// <value>The form.</value>
111 NameValueCollection Form { get; }
114 /// Gets the user languages.
116 /// <value>The user languages.</value>
117 String
[] UserLanguages { get; }
120 /// Gets the IP host address of the remote client.
122 /// <value>The IP address of the remote client.</value>
123 string UserHostAddress { get; }
126 /// Validates the input.
128 void ValidateInput();