首页 > Web开发 > 详细

nodejs

时间:2015-09-22 16:48:49      阅读:261      评论:0      收藏:0      [点我收藏+]

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

原文:http://my.oschina.net/ickewolf/blog/509624

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!