title: How do I determine the status code of a Fetch request?
body: <p>I want to fetch an URL and determine what status code it has, especially if it has an HTTP 301 or HTTP 302 status code:</p>
  
  <pre><code>fetch('https://httpstat.us/301', {
      redirect: 'true'})
      .then(response =&gt; {
         console.log(response);
         const headers = response.headers.entries();
         for (h of headers) {
          console.log(h);
          }
      }).catch(err =&gt; {
          console.log("in error case")
          console.log(err);
      })
  </code></pre>
  
  <p>This does give me a lot of information, especially it tells me via:</p>
  
  <pre><code>response.redirected 
  </code></pre>
  
  <p>Which is true. But this only tells me that it redirected, not what the status code was.</p>
  
  <p>Is there a way to use Fetch API to determine the real status code of the request? </p>