title: Web Response status code
body: <p>I have this simple function to get HTML pages and return it as a string; though sometimes I get a 404. How can I only return the HTML string only if the request was successful, and return something like <code>BadRequest</code> when it's a 404 or any other error status code?</p>
  
  <pre><code>public static string GetPageHTML(string link)
  {
      using (WebClient client= new WebClient())
      {
          return client.DownloadString(link);
      }
  }
  </code></pre>