title: Is it safe to use 'using' instead of closing a WebResponse and StreamReader
body: <h2>Currently</h2>
  
  <p>I've implemented a simple helper method for <code>HttpWebRequest</code> called <code>GetResponse(url)</code>. Currently I'm manually closing the <code>WebResponse</code> and <code>StreamReader</code> after reading the result. I'm then returning said result like so:</p>
  
  <pre><code>// construct the request
  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  request.Method = "GET";
  
  // get the result
  WebResponse response = request.GetResponse();
  StreamReader reader = new StreamReader(response.GetResponseStream());
  string result = reader.ReadToEnd();
  
  // clean up and return the result
  reader.Close();
  response.Close();
  return result;
  </code></pre>
  
  <h2>Proposed</h2>
  
  <p>Is it <em>safe</em> to encompass the return within <code>using</code> statements instead of closing them; will this have the same effect as the <code>.Close()</code>es?</p>
  
  <pre><code>// construct the request
  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  request.Method = "GET";
  
  // get the result
  using (WebResponse response = request.GetResponse())
  {
      using (StreamReader reader = new StreamReader(response.GetResponseStream()))
      {
          return reader.ReadToEnd();
      }
  }
  </code></pre>