我在发送请求时收到套接字挂起的错误消息。根据观察请求正在处理,但在发送响应时,我得到低于响应:
{
"success":false,
"error":{
"name":"RequestError","message":"Error: socket hang up","cause":{"code":"ECONNRESET"},
"error":{"code":"ECONNRESET"},
"options":{"uri":"request url","simple":true,"resolveWithFullResponse":false,"transform2xxOnly":false}
}
}
我正在使用以下代码:
var options = {
uri: 'request url',
};
request(options).then(function(data) {
res.json({
success: true,
data: data
});
})
.catch(function (err) {
res.json({
success: false,
error: err,
});
});