I have NodeJS code which looks like this
app.post("/calc", (req, res) => {
res.status(200).json({
success: true,
msg: req.body.msg,
})
})
I can't use Postman that's why I want to test this endpoint using curl. How to do this?
I tried code like this but it returned an error
curl -X POST http://localhost:3000/calc -H "Content-Type: application/json" -d '{"msg": 123456}'
Error:
Cannot bind parameter 'Headers'. Cannot convert the "Content-Type: application/json" value of type "System.String" to type "S
ystem.Collections.IDictionary".