Sunday 29 December 2019

[Express] Post request JSON problems

I am experiencing with a MERN project. It seemed to be working fine on another computer, but when running in my device, I face a problem when sending a post request to the API. The request I get is the following:{ '{\n "username": "Josh",\n "firstname": "Southy"\n}': '' } Where it should be:{ username: "Josh", firstname: "Southy" } Can't figure out what is happening but seems to be something related to JSON parser. I already use bodyparser on the server:app.use(bodyParser.urlencoded({extended: true})); app.use(bodyParser.json()); Any advice?

Submitted December 29, 2019 at 10:29PM by aShupa

No comments:

Post a Comment