title: HttpWebRequest and Response for reading large streams
body: <p>I have a requirement where I need to read large stream or data from a web server.
  This is not streaming but reading large data in chunks from the client side.</p>
  
  <p>For this purpose I create an Http Web Request. Following is the sample code..</p>
  
  <pre><code>StreamingObject streamObj = null;
  using (HttpWebRequest httpReq = WebRequest.Create(uri))
  {
      HttpWebResponse response = httpReq.GetRespons();
      Stream responseStream = response.GetStream();
  
      streamObj = new StreamingObject(response, responseStream);
  }
  return streamObj;
  </code></pre>
  
  <p>In my code I make a Http Web request to given Uri. Then I get the HttpWebResponse and the Response Stream. Create an instance of StreamingObject which is a wrapper class for storing the Http response and the response stream.</p>
  
  <p>I have disposed the Http Web Request. The client is provided with the StreamingObject and the streaming object has one method GetStream which returns the underlying response stream. When the StreamingObject is disposed the Http response and the stream is disposed.</p>
  
  <p>The reason for introducing the StreamingObject was that the Http Response has to be kept open for accessing the underlying stream. </p>
  
  <p>I wish to know whether this is a correct approach or there is simpler way of doing.</p>