一、微信小程序
wx.request({
method:'POST',
url: 'http://jdfshgsgerkkp', //仅为示例,接口地址
data: {
x: '',
y: ''
},
header: {
'content-type': 'application/json' // 默认值
},
success (res) {
console.log(res.data)
}
})
二、ajax
$.ajax({
type: "POST", //请求方式
url: "../user/selectById", //请求接口
data: decodePass, // dataType: 'JSON',
contentType: 'application/json;charset=utf-8',
async: false, //异步
success: function(res) {
}
});
三、vue
this.$axios({
method: "post",
url: this.HOST + "/systemAdmin/update",
data: this.roleform[0]
}).then(res => {
});
或
this.$axios.post(url, this.data).then(res => {
}