title: PUT request doesn't work on Axios
body: <p>I want to update the data of the row of my table developed with <strong>Node.js</strong> on the backend, <strong>React</strong> on frontend and <strong>MySQL</strong> about the database.</p>
  
  <p><strong>My Edit class:</strong>   </p>
  
  <pre><code>constructor(props) {
    super(props)
    this.state = {
      clients: [],
      Prenom: '',
      Nom: '',
      FAX: '',
      Telephone: '',
      Email: '',
      Adresse1: '',
      Adresse2: '',
      Code: props.match.params.Code
    }
    // this.logChange = this.logChange.bind(this);
    this.handleEdit = this.handleEdit.bind(this);
  }
  handleEdit(event) {
    //Edit functionality
    //event.preventDefault()
    var client = {
      Prenom: this.state.Prenom,
      Nom: this.state.Nom,
      FAX: this.state.FAX,
      Telephone: this.state.Telephone,
      Email: this.state.Email,
      Adresse1: this.state.Adresse1,
      Adresse2: this.state.Adresse2
    }
    axios({
      method: 'put',
      url: "http://localhost:4000/app/editclient/" + this.props.match.params.Code,
      data: client,
      withCredentials: true,
      headers: {
        "Access-Control-Allow-Origin": "*",
        "Content-Type": "application/json",
        "Accept": "application/json",
      }
    }).then(function(response) { // empty form
      this.setState({
        Code: ""
      });
      this.setState({
        Prenom: ""
      });
      this.setState({
        Nom: ""
      });
      this.setState({
        FAX: ""
      });
      this.setState({
        Telephone: ""
      });
      this.setState({
        Email: ""
      });
      this.setState({
        Adresse1: ""
      });
      this.setState({
        Adresse2: ""
      });
    }.bind(this)).catch(function(error) {
      console.log(error);
    });
    event.preventDefault();
  }
  &lt;Button type="submit" color="success" onClick={(event) =&gt; this. handleEdit(event)} &gt;Modifier&lt;/Button&gt;
  </code></pre>
  
  <p><strong>My router:</strong> </p>
  
  <pre><code>exports.editclient = function(req, res) {
    var data = {
      Prenom: req.body.Prenom,
      Nom: req.body.Nom,
      FAX: req.body.FAX,
      Telephone: req.body.Telephone,
      Email: req.body.Email,
      Adresse1: req.body.Adresse1,
      Adresse2: req.body.Adresse2,
    };
    var Code = req.params.Code
    console.log(req.params);
    // var Code = data.Code
    connection.query("UPDATE clients set ? WHERE Code = ? ", [data, req.params.Code], function(error, results, fields) {
      if (error) throw error;
      else {
        res.send(JSON.stringify(results));
        console.log("Data is updated");
      }
    });
  };
  </code></pre>
  
  <p><strong>My server:</strong> </p>
  
  <pre><code>router.put('/editclient/:Code', clients.editclient);
  </code></pre>
  
  <p>I run the backend with Postman with URL  <code>http://localhost:4000/app/editclient/2222</code> it works well, but when I run the frontend, the data are not updated and I get : </p>
  
  <p><a href="https://i.stack.imgur.com/0sRem.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0sRem.png" alt="enter image description here"></a></p>
  
  <p>How can I fix that ? </p>