云函数里面 调用微信支付的退款接口, 总是: ECONNRESET
不知错误处在哪里?
let res = await rp({
uri: "https://api.mch.weixin.qq.com/secapi/pay/refund",
method: 'POST',
body: formData,
headers: {
'User-Agent': 'Request-Promise'
}
}, function(e){console.log(e)}).then(function (data) {
console.log(data)
}).catch(function (err) {
console.log(err)
})
错误日志如下:
error: { Error: socket hang up
at createHangUpError (_http_client.js:331:15)
at TLSSocket.socketOnEnd (_http_client.js:423:23)
at emitNone (events.js:111:20)
at TLSSocket.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9) code: 'ECONNRESET' },
本文网址:http://www.91bianli.com/weixinxiaochengxu/421.html