title: Perform http request with twitter tokens via nodejs
body: <p>I have the following twitter tokens:</p>
  
  <pre><code>var tokens = {
          consumer_key: 'xxx',
          consumer_secret: 'xxx',
          access_token_key: 'xxx',
          access_token_secret: 'xxx' 
  };
  </code></pre>
  
  <p>And the following http_options </p>
  
  <pre><code>var options = {
          host: 'https://api.twitter.com',
          path: '1.1/users/lookup.json?screen_name='+screen_name,
          method: 'GET',
          headers: {
              'Content-Type': 'application/json'
          }
      } 
  </code></pre>
  
  <p>I tried this but it failed</p>
  
  <pre><code>var options = {
          host: 'https://api.twitter.com',
          path: '/1.1/users/lookup.json?screen_name='+screen_name,
          method: 'GET',
          headers: {
              'Content-Type': 'application/json'
          },
          auth: {
              consumer_key: 'xxx',
              consumer_secret: 'xxx',
              access_token_key: 'xxx',
              access_token_secret: 'xxx'
          }
      } 
  </code></pre>
  
  <p>In the following code:</p>
  
  <pre><code>var http_client = require('http');
  var reqPost = http_client.request(options, function(res) {
  
      res.on('data', function(d) {
              buffer = buffer+d;
          });
      res.on('end', function() {
  
             buffer = JSON.parse(buffer);
  
             console.log("inside stream, BUFFER:",buffer);
         });
    });
  
  reqPost.write();
  reqPost.end();
  </code></pre>
  
  <p>If you open this link <a href="https://api.twitter.com/1.1/users/lookup.json?screen_name=testuser" rel="nofollow">https://api.twitter.com/1.1/users/lookup.json?screen_name=testuser</a> you might see <code>{"errors":[{"message":"Bad Authentication data","code":215}]}</code>, so I don't know exactly how should I accomplish this. Can someone help me? Thank you very much. </p>