标签:color type ons pen UNC 后端 amp get request
let params = new URLSearchParams();
params.append(‘id‘,xx)
axios({
url:‘http://127.0.0.1:8000/userctrl/shoucang‘,
method:‘post‘,
data:params,
responseType:"text",
})
.then(function(obj){
})
//后端取值:
Axios get:
axios({
url:‘http://127.0.0.1:8000/userctrl/shoucang‘,
method:‘get‘,
params:{‘id‘:xx},
responseType:"text",
})
.then(function(obj){
})
//后端取值:
Ajax post:
$.ajax({
url:"http://127.0.0.1:8000/userctrl/shoucang",
data:{‘id‘:xx},
type:"post",
async:false,
dataType:"text",
success:function(obj){
console.log(obj)
}
})
//后端取值:
Ajax get:
$.ajax({
url:"http://127.0.0.1:8000/userctrl/shoucang",
data:{‘id‘:xx},
type:"get",
async:false,
dataType:"text",
success:function(obj){
console.log(obj)
})
//后端取值:
Django + Axios & Ajax post和get 传参
标签:color type ons pen UNC 后端 amp get request
原文地址:https://www.cnblogs.com/xcsg/p/10705897.html