title: HTTPS request with node.js?
body: <p>I need to trigger a request in my node.js app. My app has a route and when it runs I am trying to hit a url that is built dynamically. So all I need is to trigger a RESt API call to somethinglike:</p>
  
  <p><code>"https://www.domainname.com/sometext/"+ var1 +"/someothertext"</code></p>
  
  <p>So I tried this:</p>
  
  <pre><code>var options = {
      host: 'www.domainname.com',
      port: 80,
      path: '/1.0/'+var1,
      method: 'GET'
  };
  
  //  trigger request 
  request(options, function(err,response,body) {
  .......
  });
  </code></pre>
  
  <p>When I run this I get this error:
  <code>options.uri is a required argument</code></p>
  
  <p>So, my goal here is to trigger the request that hits a dynamically built url. If I had a static url I could plug in the request, it would work fine.</p>
  
  <p>Infact I tried to do this:</p>
  
  <pre><code>request("https://www.domainname.com/1.0/456", function(err,response,body) {
  .......
  });
  </code></pre>
  
  <p>and this works fine.</p>
  
  <p>BUT I am trying to build the url (path) dynamically with var1 and that doesn't work.</p>
  
  <p>Any suggestion on how to do this?</p>