title: How to send parameters with http request
body: <p>I am building an app using node.js and am using the <code>request</code> package to make requests. I am trying to pass data to my server API to return all orders - my question is how can I send parameters as part of my request? My code so far:</p>
  
  <pre><code>function callback(error, response, body) {
          console.log(body); //returns empty; should return array of orders
          res.render('../views/orders');
      }
  
      var options = {
          url: 'http://localhost:3000/api/orders',
          headers: {
              host: 'localhost:3000',
              connection: 'close',
              cookie: cookieText
          },
          data: { //data and company_id are parameters I want to pass
              email: 'abc123@gmail.com',
              company_id: 'secretcompanyid'
          }
      };
  
      request(options, callback);
  </code></pre>
  
  <p>In my code, <code>email</code> and <code>company_id</code> are the parameters my server side API needs. However, the current request is not returning any data. When I console.log the parameters on the server side, it returns empty therefore I think the issue is how I am passing parameters to the server. Can someone help?</p>
  
  <p>Thanks in advance!</p>