title: How to make a https request in node.js
body: <p>I need to make a crawler. For http request i used to do this.</p>
  
  <pre><code> var http=require('http');
   var options={
     host:'http://www.example.com',
     path:'/foo/example'
   };
  
   callback=function(response){
   var str='';
   response.on('data',function(chunk){
   str+=chunk;
   });
   response.on('end', function () {
         console.log(str);
   });
   }
   http.request(options, callback).end();
  </code></pre>
  
  <p>but I have to make a crawler for  <a href="https://example.com/foo/example" rel="nofollow">https://example.com/foo/example</a>
  If I am using the same for <a href="https://example.com/foo/example" rel="nofollow">https://example.com/foo/example</a> it is giving this error</p>
  
  <pre><code> events.js:72
      throw er; // Unhandled 'error' event
            ^
  Error: getaddrinfo ENOTFOUND
  at errnoException (dns.js:37:11)
  at Object.onanswer [as oncomplete] (dns.js:124:16)
  </code></pre>