I have encountered a problem with my API in express js for a DELETE request. The API checks for a password parameter before proceeding with other tasks. Interestingly, this setup works perfectly fine when tested locally on postman, but fails to work with the hosted server on heroku.
Below is a snippet from my API code:
...
if (!req.body.password) {
return res.status(400).json({ message: "Please input the password"})
}
...
On the client side, I am using:
axios.delete('url/id', ({password: 'password'}))
.then()
.catch()
The issue lies in the fact that req.body.password is not being recognized and is showing up as undefined on the hosted server.