title: how to pass data and redirect in express
body: <p>My code is</p>
  
  <pre><code>main.post('/userlist', function(req, res, next) {
      // where did you get this?
      // var db = req.db;
      var query = connection.query("SELECT name,zaman,giriscikis FROM giriscikis where date_format(zaman,'%Y-%m-%d') between ? and ?", [req.body.bas, req.body.bitis], function(err, result) {
          if (err) throw err;
  
          console.log(result);
  
          res.send(httpResponse(result));
          return res.redirect('/zamansorgu');
  
          //console.log(req.body.bas)
          //console.log(req.body.bitis)
      });
  });
  </code></pre>
  
  <p>I want to fecth data from database and redirect to same page in the code(zamansorgu.html)</p>
  
  <p>But I get an error</p>
  
  <pre><code>Cannot set headers after they are sent to the client
  </code></pre>
  
  <p>How can I solve this problem</p>
  
  <p>thank you for your helps</p>