title: Making fetch API work with CORS after OPTIONS response
body: <p>I are trying to fetch data from our API. The API has enabled CORS support and returns the below response to the OPTIONS request:    </p>
  
  <pre><code>Access-Control-Request-Headers:content-type  
  Access-Control-Allow-Origin:*  
  </code></pre>
  
  <p>The API doesn't allow <code>'Content-type'</code> anything other than <code>'application/json'</code>. </p>
  
  <p>Using this limitation, I am trying to use the <code>fetch</code> method of React-Native to get the data. </p>
  
  <p><b>Method 1 (no-cors):  </b>   </p>
  
  <pre><code>{
      method: 'POST',
      mode: "no-cors",
      headers: {
         'content-type': 'application/json'
  }
  </code></pre>
  
  <p>With this method, the browser automatically sends the content-type as 'text/plain'. I assume this is because CORS allow just one of the three headers by default. However, since the server doesn't support this content-type, it returns an error back for unsupported content type.</p>
  
  <p><b>Method 2 (with cors or with nothing):   </b>    </p>
  
  <pre><code>{ 
      method: 'POST',
      mode: "cors", // or without this line
      redirect: 'follow',
      headers: {
          'content-type': 'application/json'
      }
  }   
  ...   
  .then(response =&gt; console.log(response))
  </code></pre>
  
  <p>In this scenario, using Chrome's F12 network tool, I can see the server returning data : the first request to the server is a <code>fetch</code> for <code>OPTIONS</code>. To this, the server replies back with an empty object along with the above headers set. The next call is the actual POST API call, to which the server responds back with a proper JSON response containing some data. However, the response which is getting on the console via my code is <code>{}</code>. I assume this is because the react's <code>fetch</code> API is returning back the response of the <code>OPTIONS</code> call instead of the actual <code>POST</code> call.   </p>
  
  <p>Is there any way to ignore the response of the OPTIONS request and get the <code>then</code> method to process the response of the subsequent request?</p>