title: HTTP Post request with credentials and form in nodejs
body: <p>I want to make an HTTP POST request to a server with credentials (username, password) and content.</p>
  
  <p>More specifically, I used various approaches without success. One of them is:</p>
  
  <pre><code>var request = require('request');
  
  request({
          url: 'https://path',
          method: 'POST',
          auth: {
                 user: 'username',
                 pass: 'password'
          },
          form: {
                 'grant_type': 'client_credentials',
                 'text' : 'input-text',
                 'features': {
                        'score': true,
                 }
          }
  }, function(err, res) {
         console.log(res);
         var json = JSON.parse(res.body);
         console.log("Access Token:", json.access_token);
  });
  </code></pre>
  
  <p>Do you have any suggestion?</p>