July 28, 2014
When overridden in a descendant class, gets or sets a value that indicates whether to buffer the data read from the Internet resource.
Assembly: System.Net (in System.Net.dll)
When is true, the data is buffered in memory so it is ready to be read by the application.
The property affects when the callback from BeginGetResponse method is called. When the property is true, the callback is raised once the entire stream has been downloaded into memory. When the property is false, the callback is raised as soon as the stream is available for reading which may be before all data has arrived.
// Change this Uri to a public server System.Uri myUri = new Uri("http://www.contoso.com"); // Create a 'HttpWebRequest' object. HttpWebRequest myHttpWebRequest=(HttpWebRequest)WebRequest.Create(myUri); // Get the 'AllowReadStreamBuffering' property and print the current value outputBlock.Text += "AllowReadStreamBuffering is "; if (myHttpWebRequest.AllowReadStreamBuffering) outputBlock.Text += "true\n"; else outputBlock.Text += "false\n"; // Set the 'AllowReadStreamBuffering' property to true. myHttpWebRequest.AllowReadStreamBuffering= false; // Now call HttpWebRequest.BeginGetResponse()