一、Get请求
- wx.request({
- url: 'http://localhost:9082/weixin/setPunna?poon='+1+'',
- method: 'GET',
- header: {
- 'content-type': 'application/json' // 默认值
- }
- })
二、Post请求
- 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("用户数据发送成功")
- }
- })