title: Node Axios module PUT request with custom HTTP headers and data
body: <p>I want to send a PUT request to an endpoint that creates an ElasticSearch index. Using the Axios NPM module for that. How do I send a request for different REST verbs with data as well as custom headers.</p>
  
  <pre><code>const options = {
  hostname: "c1-es03c.aue2l.internal",
  port: 9200,
  path: "/",
  method: "PUT",
  rejectUnauthorized: true,
  requestCert: true,
  servername: "c1-elasticsearch.internal",
  ca: [fs.readFileSync("./Root-CA.pem")],
  headers: {
  "Authorization": "Basic xxxxx"
  }
  req.write("{data here}");
  req.end();
  var req = https.request(options, callback)
  </code></pre>
  
  <p>HTTPS module works fine, how do I do the same with axios or request.</p>
  
  <p>axios.put(url, options, data) didn't work.</p>