小程序支持header传参吗,后台有这样的需求,请教下
发布于 4 年前 作者 guiyingren 19637 次浏览 来自 问答
  • 需求的场景描述(希望解决的问题)

btn: function () {

var that = this;

var params = new Object();

params.account = that.data.cellphone;

params.password = that.data.password;

params.jpushKey =‘12345647897641’

console.log(params)

wx.request({

url: getApp().data.sigh,

method: ‘POST’,

header: {

‘content-type’: ‘application/x-www-form-urlencoded’

},

data: {

params: JSON.stringify(params)

},

success: function (res) {

console.log(res)

},

fail: function (err) {

console.log(err)

}

})

}

  • 希望提供的能力

因为文档里没有,请问小程序是否支持header传参?

1 回复

支持,类似这样。具体看后台需要

回到顶部