martin823823
V2EX  ›  Node.js

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

  •  
  •   martin823823 · Aug 29, 2015 · 3624 views
    This topic created in 3976 days ago, the information mentioned may be changed or developed.
    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');
    }
    });
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1202 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:36 · PVG 01:36 · LAX 10:36 · JFK 13:36
    ♥ Do have faith in what you're doing.