title: Error: Can't set headers after they are sent in loop multiple request
body: <p>i'm beginner at nodejs,  i got a problem when request multiple url in a loop then i render it.</p>
  
  <p>Error: Can't set headers after they are sent.</p>
  
  <pre><code>at validateHeader (_http_outgoing.js:491:11)
  
  at ServerResponse.setHeader (_http_outgoing.js:498:)
  
  
  router.get('/', function(req, res, next) {
    setInterval(function(){
  
               request(url1,function (error,response,body) {
                   var data1 = JSON.parse(body);
  
                   request(url2+data1.access_token,function (error,response,body) {
                   var data_info = JSON.parse(body);
  
                                     //error when it render
                                 res.render('index', {data_info : data_info});
                              })
                          })
            },5000);
  });
  </code></pre>