title: node.js ~ express req.on('end') triggers but not req.on('data')
body: <p>Using body parser either </p>
  
  <blockquote>
    <ul>
    <li>application/x-www-form-urlencoded body parser</li>
    </ul>
  </blockquote>
  
  <p>or </p>
  
  <blockquote>
    <ul>
    <li>json body parser</li>
    </ul>
  </blockquote>
  
  <p>Yields the same results.</p>
  
  <p>This is how I'm calling the API</p>
  
  <p><code>$.ajax({ type:'post', url:'/api/order', headers: { 'GreatestHits': 'SteveMillerBand' }, data: { 'the': 'greatest' } });</code></p>
  
  <p><strong>Why isn't <code>.on('data')</code> triggering</strong>? <strong>Isn't <code>body</code> simply the <code>data</code> object of the request, pretty much</strong>?  I am seeing the form data logging to the console.  I can also direct the post to <code>http://httpbin.org/post</code> to prove the point.
  I can only believe the Express is the real c@ blocker.  If that is not it then I at a loss.</p>
  
  <pre><code>// this is the code being called by the $.ajax()
  app.use(function (req, res) {
      console.log("app.use req.data", req.data);
      req.on('data', function (chunk) {
          console.log("req.use on data");
      }).on('end', function () {
          console.log("app.use on end");
      });
      res.sendStatus(200);
  });
  </code></pre>
  
  <p>On the <code>$.ajax()</code> post each of the following models, based on the above code, results as shown:</p>
  
  <p><code>app.use(callback() {} )</code></p>
  
  <blockquote>
    <ul>
    <li>has req.body</li>
    <li>does not have req.data (undefined)
    
    <ul>
    <li>will NOT trigger .on('data');</li>
    <li>will NOT trigger .on('end');</li>
    </ul></li>
    </ul>
  </blockquote>
  
  <p>.</p>
  
  <p><code>app.post(callback() {} )</code> </p>
  
  <blockquote>
    <ul>
    <li>will not even be called unless a route string is included.</li>
    </ul>
  </blockquote>
  
  <p>.
  <code>app.post('route', callback() {} )</code></p>
  
  <blockquote>
    <ul>
    <li>has <code>req.body</code></li>
    <li>does not have <code>req.data</code> (undefined)
    
    <ul>
    <li>will NOT trigger <code>.on('data');</code></li>
    <li>will NOT trigger <code>.on('end');</code></li>
    </ul></li>
    </ul>
  </blockquote>
  
  <p>.</p>
  
  <p><code>app.use('route', callback() {} )</code></p>
  
  <blockquote>
    <ul>
    <li>has <code>req.body</code></li>
    <li>does not have <code>req.data</code> (undefined)
    
    <ul>
    <li>will NOT trigger <code>.on('data');</code></li>
    <li>will trigger <code>.on('end');</code></li>
    </ul></li>
    </ul>
  </blockquote>