title: How to make post request with axios and save the q to localstorage react js
body: <p>i have problem with post request. i have a url that can acces by post request. and i want to login with post request by using clientid, clientsecret, username, password. and when i login, console log return error. 400. </p>
  
  <pre><code>      const { dispatch } = this.props;
        //alert(`Name: ${this.state.name} , Phone: ${this.state.username} , Email: ${this.state.email}  `);
        const user = {
            clientId : this.state.formData.clientId,
            clientSecret : this.state.formData.clientSecret,
            username: this.state.formData.username,
            password :this.state.formData.password,
        }
  
        axios.post(`http://10.50.51.21:8062/token`,{user})
  
        .then(res=&gt;{
          console.log(res);
          console.log(res.data.user);
          // dispatch(userLogin(this.state.formData.username, this.state.formData.password));
          // customHistory.push('/Dashboard');
  
        })
        .catch(error=&gt;console.log('parsing failed',error));
      }```
  </code></pre>