title: Invalid protocol: undefined - NodeJS error on POST request -
body: <p>I'm getting this error coming from my require.post(error)<br>
  its a lambda function deployed from a vagrant box. It is a wrapper for an api, the event.body has the properly formatted post json and everything is working perfectly when the post is done from postman. I have seen a roughly similar problem solved by </p>
  
  <pre><code>npm config set proxy http://usr:pwd@host:port
  npm config set https-proxy http://usr:pwd@host:port
  </code></pre>
  
  <p>Please help! : ) </p>
  
  <pre><code>Error: Invalid protocol: undefined
  at Request.init (/var/task/node_modules/request/request.js:454:31)
  at new Request (/var/task/node_modules/request/request.js:127:8)
  at request (/var/task/node_modules/request/index.js:53:10)
  at Function.post (/var/task/node_modules/request/index.js:61:12)
  at module.exports.startVerifyProcess (/var/task/handler.js:83:13)
  </code></pre>
  
  <p>my Code:</p>
  
  <pre><code>module.exports.startVerifyProcess = (event, context, callback) =&gt; {
      var body = JSON.parse(event.body);
      const params = querystring.parse(event.body);
  console.warn(body);
  var Re;
  
      var post_options = {
          host: 'api.demo.veri.com',
          path: '/api/v1/verify/requests',
          port: 443,
          method: 'POST',
          headers: {
             // 'Content-Type': 'application/json',
             // 'Content-Length': Buffer.byteLength(event.body),
              "Authorization": "myValidAuth",
          },           
      }
  
      request.post(post_options, body, function(err, res, resBody) {
              if (err){
                  console.error(err);
              }
  
          console.warn("RESPONSE "  + resBody);
          });
  
      callback(null, {
          statusCode: 200,
          body: JSON.stringify({
              body: Re
          })
      });
  }
  </code></pre>