title: How convert http status code into number?
body: <p>I read the <code>status</code> code of http like this:</p>
  
  <pre><code>HttpWebRequest request = WebRequest.Create(requestURI) as HttpWebRequest;
  string text;
  
  HttpStatusCode status;
  
  using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
  using (var responseStream = new StreamReader(response.GetResponseStream()))
  {
     text = responseStream.ReadToEnd();
     status = response.StatusCode;
  }
  </code></pre>
  
  <p>now if the API return <code>204</code> instead of the number (204) I get:</p>
  
  <blockquote>
    <p>No content</p>
  </blockquote>
  
  <p>I tried to covert into: <code>status = (int) response.StatusCode;</code> but the compiler tell me:</p>
  
  <blockquote>
    <p>Redundant cast</p>
  </blockquote>
  
  <p>What I did wrong?</p>