title: What is req.body in node?
body: <p>I am learning nodejs and express, during my studies I don't understand various uses of <code>req</code> such as: </p>
  
  <pre><code>var id = req.params.id;
  var wine = req.body;
  </code></pre>
  
  <p>With my <code>req</code> object I think am acessing <code>body, params.id</code>, but I do not understand how this works and what result I should expect. Can anyone explain this code in a simpler step by step manner so i can make sense of it ?</p>
  
  <p>Below is some example code where the above is used :</p>
  
  <pre><code> exports.addDoctor = function(req,res){
          var doctor = req.body;
          console.log(doctor);
              db.collection('doctors',function(err,collection){
              collection.insert(doctor,{safe:true},function(err,result){
                  if (err) {
                      res.send({'error':'An error is occured'});
                  } else {
                      console.log('Success: ' + JSON.stringify(result[0]));
                      res.send(result[0]);
                  }
              });
          });
      }
  </code></pre>
  
  <p>In the above example <code>console.log(doctor)</code> only returns <code>{}</code>. Why is this and is it because I have missed something else within the code specifically involving 'req'? </p>