title: reactjs axios get request with custom header
body: <p>I need to do this call</p>
  
  <pre><code>axios.get("http://127.0.0.1/myapi/test.php").then((response) =&gt; {
  })
  </code></pre>
  
  <p>If I do this call all is ok and HTTP method is GET, but if I change to this</p>
  
  <pre><code>var config = {
      headers: {"X-Id-Token": "abc123abc123"}
  };
  axios.get("http://127.0.0.1/myapi/test.php", config).then((response) =&gt; {
  })
  </code></pre>
  
  <p>The HTTP method is OPTIONS and the call fails, why?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I'm runnig reactjs project with node (localhost:3000) and I call php api on IIS (<a href="http://127.0.0.1/myapi" rel="noreferrer">http://127.0.0.1/myapi</a>)</p>
  
  <p><strong>SOLUTION</strong></p>
  
  <p>Axios client makes a "ping" request for to check if address is reachable.
  So, the first call is in OPTIONS method, later calls are in GET.</p>