title: Node.js: How to send headers with form data using request module?
body: <p>I have code like the following:</p>
  
  <pre><code>var req = require('request');
  
  req.post('someUrl',
     { form: { username: 'user', password: '', opaque: 'someValue', logintype: '1'}, },
     function (e, r, body) {
        console.log(body);
  });
  </code></pre>
  
  <p>How can I set headers for this?
  I need user-agent, content-type and probably something else to be in the headers:</p>
  
  <pre><code>headers = { 
     'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36',
     'Content-Type' : 'application/x-www-form-urlencoded' 
  };
  </code></pre>
  
  <p>I've tried in multiple ways but I can either send header or form-data, failed to send both.</p>