title: Error when trying to acess API with http.get in node.js
body: <p>I'm a begginer in node.js and now I'm trying to get API's result from http.get. But, when running the code I'm receiving this error:</p>
  
  <pre><code>Error: getaddrinfo ENOTFOUND
  Error: getaddrinfo ENOTFOUND
  at errnoException (dns.js:37:11)
  at Object.onanswer [as oncomplete] (dns.js:124:16)
  </code></pre>
  
  <p>I'm requiring http correctly (I had it tested to be sure)
  Here is my function to illustrate the problem:</p>
  
  <pre><code>function getData(apiUrl, getUrl) {
  
      var options = {
          host : apiUrl,
          port : 80,
          path : getUrl
      };
  
      var content = "";
  
      http.get(options, function(res) {
          console.log("Got response: " + res.statusCode);
  
          res.on("data", function(chunk) {
  
              content += chunk;
              console.log(content);
  
          });
  
      }).on('error', function(e) {
          console.log("Error: " + e.message); 
          console.log( e.stack );
      });
  
  }
  </code></pre>
  
  <p>And calling it this way:</p>
  
  <pre><code>getData('https://api.twitter.com', '/1/statuses/user_timeline.json?&amp;screen_name=twitter&amp;callback=?&amp;count=1');
  </code></pre>
  
  <p>Hope you can help me, thanks!</p>