Ran*_*lue 116 node.js connect.js
Connect.js 非常简洁的文档说methodOverride
提供虚拟HTTP方法支持.
那是什么意思?在明显的谷歌搜索不到有帮助的.为什么methodOverride有用?
ale*_*lex 147
DELETE和PUT,methodOverride是该.app.deleteand app.put而不是一直使用app.post(因此更具描述性,详细):后端:
// the app
app.put('/users/:id', function (req, res, next) {
// edit your user here
});
Run Code Online (Sandbox Code Playgroud)
客户逻辑:
// client side must be..
<form> ...
<input type="hidden" name="_method" value="put" />
</form>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22732 次 |
| 最近记录: |