title: WebRequest hangs user interface
body: <p>I'm doing simple request with WebRequest and the app just hangs until the response comes back. How do I fix this?</p>
  
  <p>I have read a lot of topics and they all say to use threads. I don't know how to use them; can anyone provide an example of the following that doesn't hang the user interface?</p>
  
  <pre><code>private string SimpleRequest(String url)
  {
      WebRequest request = WebRequest.Create(url);
      WebResponse response = request.GetResponse();
      Stream stream = response.GetResponseStream();
      StreamReader reader = new StreamReader(stream);
      string result = reader.ReadToEnd();
      stream.Dispose();
      reader.Dispose();
      return result;
  }
  
  private void button1_Click(object sender, EventArgs e)
  {
      String googleHtml = simpleRequest("https://facebook.com");
  }
  </code></pre>
  
  <p>Thanks!</p>