title: nodeJS - make HTTPS request, sending JSON data
body: <p>I would like to send an HTTPS POST from one nodeJS server to another. I have some JSON data I would like to send with this request (populated by a html form).</p>
  
  <p>How can I do this? I am aware of https.request() but there does not seem to be an option to include JSON as a part of the query. From my research it seems possible with an HTTP request, but not an HTTPS request. How can I solve this?</p>
  
  <pre><code>const pug = require('pug');
  var cloudinary = require('cloudinary');
  var express = require('express');
  var multer = require('multer');
  var upload = multer({ dest: 'uploads/' });
  var request = require('request');
  var bodyParser = require('body-parser');
  
  var options = {
   hostname: 'ec2-54-202-139-197.us-west-2.compute.amazonaws.com',
   port: 443,
   path: '/',
   method: 'GET'
  };
  
  var app = express();
  var parser = bodyParser.raw();
  app.use(parser);
  
  app.set('view engine', 'pug');
  
  app.get('/', upload.single('avatar'), function(req, res) {
   return res.render('index.pug');
  });
  
  app.get('/makeRequest*', function(req, res) {
   query = req['query'];
   /*
   Here, I would like to send the contents of the query variable as JSON to the server specified in options.
   */
  });
  </code></pre>