title: React Login Component on Axios
body: <p>How to make React Login Component via API and Redirect to home while give session (via Jwt)?</p>
  
  <p>I've tried using default Axios function but stuck with the 404 Error, while the API can be reach via GET</p>
  
  <p>Below is Login.js</p>
  
  <pre><code> handleSubmit = input =&gt; {
      this.setState({ loading: true });
      input.preventDefault();
  
      if (this.formisValid(this.state)) {
        this.setState({ errors: [], loading: true });
        axios({
          method: 'POST',
          url: 'http:localhost:3003/api/v1/login',
          data: {
            email    : this.state.email,
            password : this.state.password
          }
        }).then( user =&gt; {
  
          this.setState({ 
            initialState,
            submit: true
          });
          this.setState({ loading: false});
          console.log('User Login', user)
  
        }).catch((response) =&gt; {
          // ? Show to user that request is failed
          this.setState({ errors:[response ]})
          this.setState({ loading: false });
          console.log('request failed', response)
        });
      }
    };
  </code></pre>
  
  <p>Below is the API GET Login result (via browser)</p>
  
  <pre><code>{"success":false,"data":{"error":"Body cannot be empty"}}
  </code></pre>
  
  <p>The expected result is User can be directed to home (/) after login success (and have session via Jwt)</p>
  
  <p>Thanks for any help</p>