title: Nodejs how to set content-type header for every request
body: <p>I would like to know how I can set the header <code>"Content-Type": "application/json"</code> for every nodejs express request that comes in. </p>
  
  <p>I tried both of these lines but my calls are still failing if I don't add the header myself:</p>
  
  <pre><code>app.use(function(req, res, next) {
      req.header("Content-Type", "application/json");
      res.header("Content-Type", "application/json");
      next();
  });
  </code></pre>
  
  <p>All of my requests are json, so I don't want the front end (Anguler) to send me this header every time if I can just set it myself from the server side.</p>