title: Response Stream from HttpWebRequest lifetime scope
body: <p>I have this method:</p>
  
  <pre><code>public Stream Load(string term)
  {
      var url = CreateSearchUrl(term);
  
      var webRequest = (HttpWebRequest)WebRequest.Create(url);
      var webResponse = webRequest.GetResponse();
  
      return new GZipStream(webResponse.GetResponseStream(), CompressionMode.Decompress);
  }
  </code></pre>
  
  <p>As you can see, I return the stream back to the caller but I'm not sure if this is safe in terms of the WebRequest gets disposed by the runtime and thus invalidating my returned stream.</p>
  
  <p>I could convert it to a byte array and return a MemoryStream or even use a WebClient but I just don't like this idea =).</p>
  
  <p>Thanks!</p>