/// <summary> /// Initializes a new instance. /// </summary> /// <param name="uri"></param> public DynamicWebRequest(Uri uri) : base() { Contract.Requires <ArgumentNullException>(uri != null); Contract.Requires <ArgumentOutOfRangeException>(uri.Scheme == DynamicUriHelper.UriSchemeDynamic); this.uri = uri; this.method = "GET"; this.contentLength = 0; this.headers = new WebHeaderCollection(); this.stream = new MemoryStream(); this.response = new Lazy <WebResponse>(() => DynamicUriRegistry.Get(new Guid(RequestUri.Authority)).GetResponse(this)); }
/// <summary> /// Disposes of the instance. /// </summary> public void Dispose() { DynamicUriRegistry.Unregister(this); }
/// <summary> /// Initializes a new instance. /// </summary> protected DynamicUriAuthority() { this.id = Guid.NewGuid(); DynamicUriRegistry.Register(this); }