2014-02-07 2 views
0

이 HTTP 요청을 보내는 코드입니다. 내 요청이 왜 끝나지 않는지 잘못된 것이 있습니까?노드 Js에서 HTTP 요청 끝내기

var req = http.request(options, function(res) { 
     res.setEncoding('utf8'); 
     res.on('data', function(chunk) { 
      console.log('Response: ' + chunk); 
     }); 
    }); 

    req.write(uid); 
    req.end();   //i think this line will end the requset, but not. 

답변 주셔서 감사합니다.

답변

0

나는 내가 res.end();

var req = http.request(options, function(res) { 
     res.setEncoding('utf8'); 
     res.on('data', function(chunk) { 
     console.log('Response: ' + chunk); 
     }); 
    }); 

    req.write(uid); 
    req.end(); 
    res.end(); 
와 응답을 종료 놓친 발견
관련 문제