title: mode: 'no-cors' working with fetch but fails for axios
body: <p>I prefer axios over fetch because of its simplicity and ease-of-use. I am running a local dev server which sends AJAX requests to some remote endpoint. The request gets blocked due to the same-origin-policy. So I modified my webpack config like this:</p>
  
  <pre><code>devServer: {
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
  },
  </code></pre>
  
  <p>Now if I use fetch for making API requests, I add <code>"mode": "no-cors"</code> to allow cross origin requests and everything works fine. However, this does not work with axios.</p>
  
  <p>Whereas fetch is based on <a href="https://developer.mozilla.org/en-US/docs/Web/API/Request" rel="noreferrer">Request API</a>, which allows specifying mode: "no-cors", axios is based on XHR, which has no support for specifying mode.
  I can work around the issue by opening an insecure chrome window by running <code>chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security</code> where <code>--user-data-dir</code> is some path of my file system. However, an insecure chrome instance won't allow extensions to run, so I can't use React and Redux DevTools. 
  Here is a snippet that uses fetch and axios to make requests. The fetch call works while axios fails:</p>
  
  <pre><code>componentDidMount() {
    fetch(someAPIEndpoint, {
      mode: 'no-cors',
    })
    .then(response =&gt; console.log(response))
    .catch(error =&gt; console.error(error))
  
    axios
    .get(someAPIEndpoint, {
        mode: 'no-cors',
    })
    .then(results =&gt; console.log(results))
    .catch(error =&gt; console.error(error))
  }
  </code></pre>
  
  <p>Using a proxy server is not possible in my situation either. Is there any other workaround in code so that i can use axios and bypass this issue. Thanks in advance!!!</p>