nodejs

http post 请求 http://127.0.0.1:xxxx/instorePhoto

需要 

var bodyParser = require('body-parser');

app.use(bodyParser.urlencoded({ extended: false }));


router.post("/instorePhoto", function(req, res){

console.log(req.body);

});


http get请求http://127.0.0.1:xxxx/employees

router.get("/employees",function(req,res){

console.log(req.query);

})

http get请求http://127.0.0.1:xxxx/employees/2

router.get("/employees/:id",function(req,res){

console.log(req.params);

})


你可能感兴趣的:(nodejs)