title: How do I make a https post in Node Js without any third party module?
body: <p>I'm working on a project that requires https get and post methods. I've got a short https.get function working here...</p>
  
  <pre><code>const https = require("https");
  
  function get(url, callback) {
      "use-strict";
      https.get(url, function (result) {
          var dataQueue = "";    
          result.on("data", function (dataBuffer) {
              dataQueue += dataBuffer;
          });
          result.on("end", function () {
              callback(dataQueue);
          });
      });
  }
  
  get("https://example.com/method", function (data) {
      // do something with data
  });
  </code></pre>
  
  <p>My problem is that there's no https.post and I've already tried the http solution here with https module <a href="https://stackoverflow.com/questions/6158933/how-to-make-an-http-post-request-in-node-js">How to make an HTTP POST request in node.js?</a> but returns console errors.</p>
  
  <p>I've had no problem using get and post with Ajax in my browser to the same api. I can use https.get to send query information but I don't think this would be the correct way and I don't think it will work sending files later if I decide to expand.</p>
  
  <p>Is there a small example, with the minimum requirements, to make a https.request what would be a https.post if there was one? I don't want to use npm modules.</p>