Taro.request({
url: 'https://...',
success: function(res){
console.log(res)
},
fail: function(res){
console.log(res)
},
})
Taro.request({
url: 'http://localhost:8080/test',
data: {
foo: 'foo',
bar: 10
},
header: {
'content-type': 'application/json'
}
})
.then(res => console.log(res.data))
文档里面写可以用success和fail的啊
@btstack 已经修复啦,下个版本支持
感谢! @luckyadam
Most helpful comment
Taro.request({
url: 'http://localhost:8080/test',
data: {
foo: 'foo',
bar: 10
},
header: {
'content-type': 'application/json'
}
})
.then(res => console.log(res.data))