29 using System.Collections.Specialized;
32 using HttpServer.FormDecoders;
34 namespace OpenSim.Tests.Common
38 private string _uriPath;
39 public bool BodyIsComplete
43 public string[] AcceptTypes
45 get {
return _acceptTypes; }
47 private string[] _acceptTypes;
54 public ConnectionType Connection
56 get {
return _connection; }
57 set { _connection = value; }
59 private ConnectionType _connection;
60 public int ContentLength
62 get {
return _contentLength; }
63 set { _contentLength = value; }
65 private int _contentLength;
66 public NameValueCollection Headers
68 get {
return _headers; }
70 private NameValueCollection _headers =
new NameValueCollection();
72 public string HttpVersion {
get; set; }
76 get {
return _method; }
77 set { _method = value; }
79 private string _method = null;
80 public HttpInput QueryString
82 get {
return _queryString; }
84 private HttpInput _queryString = null;
90 private Uri _uri = null;
91 public string[] UriParts
93 get {
return _uri.Segments; }
95 public HttpParam Param
105 get {
return false; }
107 public RequestCookies Cookies
114 HttpVersion =
"HTTP/1.1";
118 string remoteAddr,
string remotePort,
string[] acceptTypes,
119 ConnectionType connectionType,
int contentLength, Uri uri) : base()
121 _headers[
"content-encoding"] = contentEncoding;
122 _headers[
"content-type"] = contentType;
123 _headers[
"user-agent"] = userAgent;
124 _headers[
"remote_addr"] = remoteAddr;
125 _headers[
"remote_port"] = remotePort;
127 _acceptTypes = acceptTypes;
128 _connection = connectionType;
129 _contentLength = contentLength;
137 _headers.Add(name, value);
139 public int AddToBody(byte[] bytes,
int offset,
int length)
148 clone._acceptTypes = _acceptTypes;
149 clone._connection = _connection;
150 clone._contentLength = _contentLength;
152 clone._headers =
new NameValueCollection(_headers);
158 return new HttpResponse(context,
this);
164 public string UriPath
166 get {
return _uriPath; }
void AddHeader(string name, string value)
void DecodeBody(FormDecoderProvider providers)
int AddToBody(byte[] bytes, int offset, int length)
TestHttpRequest(string contentEncoding, string contentType, string userAgent, string remoteAddr, string remotePort, string[] acceptTypes, ConnectionType connectionType, int contentLength, Uri uri)
void SetCookies(RequestCookies cookies)
IHttpResponse CreateResponse(IHttpClientContext context)