title: Make Requests in Sequential Order Node.js
body: <p>If I need to call 3 http API in sequential order, what would be a better alternative to the following code:</p>
  
  <pre><code>http.get({ host: 'www.example.com', path: '/api_1.php' }, function(res) { 
    res.on('data', function(d) { 
  
      http.get({ host: 'www.example.com', path: '/api_2.php' }, function(res) { 
        res.on('data', function(d) { 
  
          http.get({ host: 'www.example.com', path: '/api_3.php' }, function(res) { 
            res.on('data', function(d) { 
  
  
            });
          });
          }
        });
      });
      }
    });
  });
  }
  </code></pre>