【问题标题】:Socket hang up error in http request on nodejsnodejs上http请求中的套接字挂起错误
【发布时间】:2013-05-17 09:54:26
【问题描述】:

嗨,我是使用复合作为框架的 nodejs 新手,我在通过 https 请求时遇到错误。我试过简单的代码是

 action(function getteams(req){
 Mymodel.find({"season": body.year}, function(err, team){
     console.log("Season "+ body.year)
    if(!err) return send(team);
    return console.log(err);
    })
 })

当我将 body.year 硬编码为“2001”时,我得到了答案,但如果通过 http 发送请求,则会出现名为“socket hang up”的错误。如何遇到这个。

【问题讨论】:

  • 问题看不懂?

标签: node.js sockets compoundjs


【解决方案1】:

不清楚你是否描述了它。但是不要忘记http请求 never res.send(data) OR res.end()

【讨论】:

    猜你喜欢
    • 2020-06-17
    • 2013-11-16
    • 2015-09-13
    • 2014-10-02
    • 2014-10-06
    • 1970-01-01
    • 2014-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多