# RequestTask

Start from base library version 1.4.0. Please remaining backward compatible.

Network Request Task Object

# method

# RequestTask.abort()

Interrupt request task

# RequestTask.onHeadersReceived(function callback)

to monitor HTTP Response Header Events. Will be earlier than the request to complete the event

# RequestTask.offHeadersReceived(function callback)

Cancel the wiretap. HTTP Response Header event

# sample code

const requestTask = wx.request({
  url: 'test.php', //Just an example, not a real interface address
  data: {
    x: '' ,
    and: ''
  },
  header: {
    'content-type': 'application/json'
  },
  success (res) {
    console.log(res.data)
  }
})
requestTask.abort() // Cancel the request task