赞
踩
axios 中get 传参
axios.get('url',{params:{name:zhang })
- axios({
- url:'url',
- methods:'get',
- params:{
- name:zhang
- }
- })
axios.get('url?55')
axios中post 传参
axios.post('url', { name:zhang} )
- axios({
- url:'url',
- methods:'get',
- data:{
- name:zhang
- }
- })
node接受get参数
- router.get('/gettext',function(req,res,next){
- const params= req.params.id
- console.log(params) //{name:zhang}
- res.send(params)
- })
- router.get('/gettext/:id',function(req,res,next){
- const params=req.params.id
- consol.log(params) //55
- })
node接受post参数
- router.post('/posttext',function(req,res,next){
- const query=req.body
- console.log(query) //{name:zhang}
- res.send(query)
- })
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。