title: How to send http post call from node server?
body: <p>I have trying to send post call on <code>https://api-mean.herokuapp.com/api/contacts</code> with following data:</p>
  
  <pre><code>{
      "name": "Test",
      "email": "test@xxxx.in",
      "phone": "989898xxxx"
  }
  </code></pre>
  
  <p>But not get any response.
  I have also tried it with postman it working fine. I have get response in postman.</p>
  
  <p>I am using following nodejs code:</p>
  
  <pre><code>        var postData = querystring.stringify({
              "name": "Test",
              "email": "test@xxxx.in",
              "phone": "989898xxxx"
          });
  
          var options = {
              hostname: 'https://api-mean.herokuapp.com',
              path: '/api/contacts',
              method: 'POST',
              headers: {
                  'Content-Type': 'application/json'
              }
          };
  
          var req = http.request(options, function (res) {
              var output = '';
              res.on('data', function (chunk) {
                  output += chunk;
              });
  
              res.on('end', function () {
                  var obj = JSON.parse(output.trim());
                  console.log('working = ', obj);
                  resolve(obj);
              });
          });
  
          req.on('error', function (e) {
              console.error(e);
          });
  
          req.write(postData);
          req.end();
  </code></pre>
  
  <p>Am I something missing?</p>
  
  <p>How to send http post call from node server?</p>