微信小程序 请求url

 

 

wx.request({
  url: 'https://example.com/api/data', // 替换为你的目标URL
  method: 'POST',
  data: {
    key1: 'value1', // 提交的数据
    key2: 'value2'
  },
  success(res) {
    console.log('请求成功', res.data);
  },
  fail(err) {
    console.log('请求失败', err);
  }
});

 

 

##################

posted @ 2024-01-05 21:29  西北逍遥  阅读(98)  评论(0编辑  收藏  举报