title: node express mysql driver insert action error
body: <p>I try to code rest API using express and mysql but i have problem with inserting data to database</p>
  
  <pre><code>router.route('/todo')
  .post(function(req, res){
      if(connection){
          var obj = {
              task: req.body.task, 
              date: Date()
          }
          connection.query('insert into task set ?', obj , function(err, info){
              if (err) throw err;
              console.log('dodano z id:' + info.insertId);
              res.redirect('/');
          });
      }
  })
  .get(function(req, res){
      if(connection) {
          connection.query('select * from task order by id', function(err, rows){
              if(err) throw err;
              res.json(rows);
              res.end;
          });
      }
  });
  </code></pre>
  
  <p>I use a simple firefox plugin for restfull api and when i send Post method {"task":"one"} i get this error on console: Error: ER_BAD_NULL_ERROR: Column 'task' cannot be null.</p>
  
  <p>What i do wrong?</p>