一、Get請求文章來源:http://www.zghlxwxcb.cn/news/detail-573340.html
wx.request({
url: 'http://localhost:9082/weixin/setPunna?poon='+1+'',
method: 'GET',
header: {
'content-type': 'application/json' // 默認(rèn)值
}
})
二、Post請求文章來源地址http://www.zghlxwxcb.cn/news/detail-573340.html
wx.request(
{
url:"http://localhost:9082/weixin/setPunna",
header:{
"Content-Type":"application/x-www-form-urlencoded"
},
method:"POST",
data:{
poon:this.data.list,
nickname:this.data.userInfo.nickName,
},
dataType:"json",
complete:function(res) {
console.log("用戶數(shù)據(jù)發(fā)送成功")
}
})
到了這里,關(guān)于微信小程序-發(fā)送Get/Post請求的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!