1.1网络请求的概念(post和get)

1.2步骤
1.3 应用函数
js里面写,用bindtap绑在控件上,就不讲了

实例代码:
//发起get数据请求
get_info(){
wx.request({
url:'https://www.escook.cn/api/get',
//请求的接口地址,必须基于https协议//请求的方式
method: 'GET',
//发送到服务器的数据
data: {name: 'zs',age: 22},
success:(res)=>{
console.log(res);
}
})
},
//发起post数据请求
post_info(){
wx.request({
url:'https://www.escook.cn/api/post',
//请求的接口地址,必须基于https协议//请求的方式
method: 'POST',
//发送到服务器的数据
data: {name: 'zs',age: 22},
success:(res)=>{
console.log(res);
}
})
},


![克隆图[中等]](https://img-blog.csdnimg.cn/direct/b88623227d314c23bf96de03d697817b.png)

















