[Answered ]-400 bad request during axios call

1👍

If you are doing post processing, you can convert the Data to Json format and send it.

   var post_data = {
    your_post_name: this.state
  };

  axios
    .post(url, JSON.stringify(post_data))
    .then((response) => {

      console.log(response);
    })
    .catch((error) => {
      console.log(error);
    });

or

      axios
.post(url,JSON.stringify({your_post_name:this.state}))
        .then((response) => {

          console.log(response);
        })
        .catch((error) => {
          console.log(error);
        });

0👍

I solved the issue state had typo in title needed to be collection_title.

Leave a comment