title: How to get data from POST request
body: <p>I am confused as how to get the data from the post request and also to then send it to the sheets. I do not know how to also confirm it with the client. any help would be greatly appreciated thank you.</p>
  
  <p>i am trying to build a web app that will be a checkin/checkout system where once someone scans a barcode, the information from that barcode will go directly into the google spreadsheet</p>
  
  <pre><code>var express = require('express');//takes everything from the Express library
  var app = express(); //calls the express constructor. app is the server object
  var fs = require('fs');
  var GoogleSpreadsheet = require('google-spreadsheet');
  var creds = require('./client_secret.json');
  
  
  app.use(express.static('public'));
  
  app.get('/', function (req, res) {
      var contents = fs.readFileSync('views/welcome.html').toString();
      res.send(contents);
  });
  
  app.get('/info', function (req, res) {
      res.send('Hello Info!');
  });
  
  app.get('/checkin', function (req, res) {
      var contents = fs.readFileSync('views/no.html').toString();
      res.send(contents);
      console.log("checking in");
      console.log(req);
  });
  
  app.get('/checkout', function (req, res) {
      var contents = fs.readFileSync('views/no.html').toString();
      res.send(contents);
      console.log("checking out");
  });
  
  app.post('/checkin', function (req, res){ //someone clicks submit on page from 
  get page
      console.log("posting checkin info");
  
  
      //getthe data from the POST request LOOOK HERE GET INFO FROM POST REQUEST
      //send it to Sheets
  //body-parser method
  var ID = data.ID; // sample
  //console.log(id);
  
  // Create a document object using the ID of the spreadsheet - obtained from 
  its URL.
  var doc = new 
  GoogleSpreadsheet(________);
  
  // Authenticate with the Google Spreadsheets API.
  doc.useServiceAccountAuth(creds, function (err) {
  
  /*  // Get all of the rows from the spreadsheet.
    doc.getRows(2, function (err, rows) {
      console.log(rows);
    });*/
  
    doc.getInfo(function(err, info) {
    console.log('Loaded doc: '+info.title+' by '+info.author.email);
    sheet = info.worksheets[0];
    console.log('sheet 1: '+sheet.title+' '+sheet.rowCount+'x'+sheet.colCount);
   // step();
  
     //look at https://www.npmjs.com/package/google-spreadsheet
  });
  });
  
  //confirm with the client
  });
  
  app.listen(3000, function () {
    console.log('Example app listening on port 3000!');
  });
  </code></pre>