Header无参数怎么调用API?

发布于 6 年前作者 weihu6847 次浏览最后编辑 6 年前来自 issues
wx.request({
  url: 'test.php', //仅为示例,并非真实的接口地址
  data: {
    x: '',
    y: ''
  },
  header: {
    'content-type': 'application/json' // ================如果API的header没有参数,这是怎么写,还是整个header都不写了==================
  },
  success (res) {
    console.log(res.data)
  }})
2 回复
li19
li191 楼6 年前

后台需要啥你就写啥,不需要可以不写就行

fujing
fujing2 楼4 年前

后台什么的不需要就不写呗