title: How do I get POST data with node.js?
body: <p>How do I get the caller ID from twilio? I've tried many different ways to get the POST data but it isn't working.</p>
  
  <pre><code>var twilio = require('./node_modules/twilio/index'),
          http = require('http'),
          express = require('express');
  
  http.createServer(function (req, res) {
  /*
  var app = express();
  app.use(express.urlencoded());
  app.post('/call',function (req, res) {
  */
          var name, from;
  //      if (req.method=='POST')
  //              req.on('From', function (data) {from = data;});
          try {
                  from = req.param('From');
                  // from = req.body.from;
          }
          catch (err)
          {
          console.log("No Caller ID");
          }
          console.log("Number: " + from);
  //Some code goes here..
  res.end(resp.toString());
  }).listen(8080);
  </code></pre>
  
  <p>It's throwing me the error every single time at the try catch statement (always null).</p>
  
  <p><em>I'm trying to get the caller ID of an incoming text message.</em></p>
  
  <p>Things in comments are the different approaches I tried.</p>
  
  <p>The thrown error is:</p>
  
  <blockquote>
    <p>Error TypeError: Object #IncomingMessage> has no method 'param'</p>
  </blockquote>