How to remove reverse slash from json in axios post request

Viewed 538

Adds reverse slash to json file when sending axios post request .Even though I use replace, backslash is not removed

 axios
      .post(
        "https://test-manager/backend",
        {
          gameName: this.gameName,
          platform: this.gamePlatform,
          json: finalData.replace(/\\/g, ""),
        }
      )
      .then(function (response) {
        console.log(response);
      })
      .catch(function (error) {
        console.log(error);
      });

enter image description here

1 Answers

You need to parse the stringified json using JSON.parse as follows :

json: JSON.parse(finalData),
Related