get请求
this.$axios.get('http://127.0.0.1:8000/cs/',{
params:{'键':值}
})
.then(res=>{
console.log(res)
})
.catch(ree=>{
console.log(ree.data.msg)
})
接收
prid = request.query_params.get('prouID')
put和和post一样
this.$axios.get('http://127.0.0.1:8000/cs/',{
{'键':值}
})
.then(res=>{
console.log(res)
})
.catch(ree=>{
console.log(ree.data.msg)
})
接收
prouID = request.data.get('prouID')
delete传参
this.$axios.get('http://127.0.0.1:8000/cs/',{
data: {'键':值}
})
.then(res=>{
console.log(res)
})
.catch(ree=>{
console.log(ree.data.msg)
})
接收
prouID = request.data.get('prouID')

本文介绍了在JavaScript前端中,使用axios库进行GET, PUT, POST和DELETE请求时的参数传递方式。对于GET请求,参数通过params字段传递;PUT和POST请求的参数传递方式相同,都是通过data字段;而DELETE请求中,参数同样通过data字段发送。"
132518217,19048838,大数据技术的演进与应用,"['大数据', '分布式计算', '流处理', '数据挖掘', '机器学习']
10万+

被折叠的 条评论
为什么被折叠?



