public Request(string method, Url url, IHttpUtility httpUtility, RequestStream body = null, IDictionary<string, IEnumerable<string>> headers = null, string ip = null) { method.ArgumentNullOrEmptyCheck("method"); url.ArgumentNullCheck("url"); url.Path.ArgumentNullOrEmptyCheck("url.Path"); url.Scheme.ArgumentNullOrEmptyCheck("url.Scheme"); httpUtility.ArgumentNullCheck("httpUtility"); this.httpUtility = httpUtility; Items = new Dictionary<string, object>(); UserHostAddress = ip; Url = url; Method = method; Query = url.Query.AsQueryDictionary(httpUtility); Body = body ?? RequestStream.FromStream(new MemoryStream()); Headers = new RequestHeaders(headers ?? new Dictionary<string, IEnumerable<string>>()); ParseFormData(); }
public Request(string method, string path, IDictionary<string, IEnumerable<string>> headers, RequestStream body, string scheme, IHttpUtility httpUtility, string query = null, string ip = null) : this(method, new Url { Path = path, Scheme = scheme, Query = query ?? String.Empty }, httpUtility, body, headers, ip) { }