美文网首页
发起get/post请求

发起get/post请求

作者: 苍老师的眼泪 | 来源:发表于2020-05-03 21:30 被阅读0次

get请求:

  submitPhoneCode() {
    wx.request({
      url: 'http://localhost:8080/upload',
      method: "get",  //如果是post请求,修改这一个地方就可以了
      data: {
        phone: this.data.phone,
        code: this.data.code
      },
      success(res) {
        console.log(res)
      },
      fail(err) {

      },

    })
  },

post请求:


相关文章

网友评论

      本文标题:发起get/post请求

      本文链接:https://www.haomeiwen.com/subject/lrvjghtx.html