WeChat Mini Program API initiates a request


wx.request(OBJECT)


wx.request initiates an https request. A WeChat applet can only have 5 network request connections at the same time.

OBJECT parameter description:

QQ截图20170208105638.png

##Sample code:

wx.request({
  url: 'test.php',
  data: {
     x: '' ,
     y: ''
  },
  header:{
      "Content-Type":"application/json"
  },
  success: function(res) {
     var data = res.data;
  }
});