V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
martin823823
V2EX  ›  Node.js

这个 post 请求的写法是否正确,能够请求到数据吗

  •  
  •   martin823823 · 2015-08-29 08:39:38 +08:00 · 2677 次点击
    这是一个创建于 3168 天前的主题,其中的信息可能已经有所发展或是发生改变。
    app.post ('/tasks',function (req, res ){
    var task = new Task (req.body.task );

    task.save (function (err ) {
    if (err ) {
    throw err;
    }
    else {
    res.redirect ('/tasks/new');
    }
    });
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   819 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 22:15 · PVG 06:15 · LAX 15:15 · JFK 18:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.