method
是 get
方式的时候,header
为
{"Content-Type": 'application/json'}
,
method
为 post
时,header
为
{"Content-Type": "application/x-www-form-urlencoded"}
wx:request
javascript
wx.request({
url: 'http://...www/runxiang_yiyao/Mobile/Index/login',
method: 'post',
data: util.json2Form({
username: e.detail.value.username,
password: e.detail.value.password,
}),
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
success: function (res) {
console.log(util.formatTime)
// console.log(res)
}
})