I am using express 4.13.3
(latest) and following code:
var express = require('express')
var app = express()
app.get('/test', function (req, res, next) {
res.send('hello!')
})
app.post('/test', function (req, res, next) {
res.redirect('/test')
})
app.put('/test', function (req, res, next) {
res.redirect('/test')
})
app.listen(5001)
// GET /test -> 'hello!'
// POST /test -> 'hello!'
// PUT /test -> ERR_TOO_MANY_REDIRECTS
POST redirects to GET but PUT redirects to PUT. Is it possible to make PUT redirect to GET (same as POST)?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…