码迷,mamicode.com
首页 > Web开发 > 详细

nodejs

时间:2015-09-22 16:51:01      阅读:203      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!