Open e314520513 opened 8 years ago
我發現 res.redirect();預設是get方法,不知道可不可以改變他的請求方法
res.redirect()
只是幫你在 Header 寫 Location ,基本上是瀏覽器幫你做 302 重新導向,所以只有 GET
ref. 原始碼(實際上是在前面的 res.location
設定了 Header)
https://github.com/expressjs/express/blob/9375a9a/lib/response.js#L857
謝謝,最後放棄put跟 delete了
目的
node 在做route的時候遇到一個問題
使用的工具
node.js express4
遇到的問題
不知道res.redirect()要怎麼寫才能重導到router.get('/todo'
程式碼