title: React JS get errors in XMLHttpRequest with Axios
body: <p>I´m using REACT-JS framework for FRONT-END:</p>
  
  <p>This is my calling action from <code>REDUX-REACT</code></p>
  
  <pre><code>export function UserLogin(values) {
      var headers = {
          'Access-Control-Allow-Origin': '*',        
          'Accept': 'application/json',
          'Content-Type': 'application/json'
      }
  
      const request = axios.post('http://localhost:8000/login', headers,  values).then(function(response){
          /*() =&gt; {callback();}*/
          console.log(response);
      })
      .catch((error) =&gt; {
          // Error
          if (error.response) {
              console.log(error.response.data);
  
          } 
          else if (error.request) {
              // The request was made but no response was received
              // `error.request` is an instance of XMLHttpRequest in the browser and an instance of
              // http.ClientRequest in node.js
              console.log(error.request);
          } 
          else {
              // Something happened in setting up the request that triggered an Error
              console.log('Error', error.message);
          }
      });
      return {
          type: LOGIN_REQUEST_SUCCESS,
          payload: request
      };
  }
  </code></pre>
  
  <p>I´m getting answer from other <code>localhost:8000</code> for testing purposes.</p>
  
  <p>I´m getting this errors:</p>
  
  <blockquote>
    <p>Failed to load <a href="http://localhost:8000/login" rel="nofollow noreferrer">http://localhost:8000/login</a>: Response to preflight
    request doesn't pass access control check: No
    'Access-Control-Allow-Origin' header is present on the requested
    resource. Origin '<a href="http://localhost:3000" rel="nofollow noreferrer">http://localhost:3000</a>' is therefore not allowed
    access.</p>
  </blockquote>
  
  <p>And the console log from <code>error.request</code></p>