In the HTTP/HTTPS web server package library “express.js” for the Node.js programming language, this article covers countermeasures, prevention methods, and causes when “Cannot POST” (Cannot GET) errors occur.
If you don’t specify a return value with res.send() as shown below, you’ll get a Cannot POST error when making an HTTP request.
app.all('/configall', function (req, res, next) {
console.log('Accessing the secret section ...')
next() // pass control to the next handler
})
curl http://192.168.0.110:8111/configall
You should write res.send() somewhere. The error is a bit unclear.
app.all('/configall', function (req, res, next) {
console.log('Accessing the secret section ...')
res.send("something here.")
next() // pass control to the next handler
})
curl http://192.168.0.110:8111/configall
This way, if you write res.send(), the Cannot POST error will no longer occur.