V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
martin823823
V2EX  ›  Node.js

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

  •  
  •   martin823823 · Aug 29, 2015 · 3488 views
    This topic created in 3894 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   ·   994 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 20:12 · PVG 04:12 · LAX 13:12 · JFK 16:12
    ♥ Do have faith in what you're doing.