title: Axios: getting two requests OPTIONS & POST
body: <p>I'm trying to post data. Everything works fine, but I don't know why I'm getting two requests <code>OPTIONS</code> &amp; <code>POST</code></p>
  <p>POST:
  <a href="https://i.stack.imgur.com/5uF2U.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5uF2U.png" alt="enter image description here" /></a></p>
  <p>OPTIONS:
  <a href="https://i.stack.imgur.com/wxQ4w.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wxQ4w.png" alt="enter image description here" /></a></p>
  <p>Here's the code:</p>
  <pre><code>const url = 'http://rest.learncode.academy/api/johnbob/myusers';
  
  export function postUsers(username, password) {
      let users = {
          username,
          password,
      };
      return{
          type: &quot;USERS_POST&quot;,
          payload: axios({
              method:'post',
              url:url,
              data: users,
          })
              .then(function (response) {
                  console.log(response);
              })
              .catch(function (error) {
                  console.log(error);
              })
      }
  }
  </code></pre>