title: How to set the location response HTTP header in Express framework?
body: <p>How to set the response <code>Location</code> HTTP header in Express? I've tried this, but it's not working:</p>
  
  <pre class="lang-js prettyprint-override"><code>  Controller.prototype.create = function(prop, res) {
      var inst = new this.model(prop);
  
      inst.save(function(err) {
        if (err) {
          res.send(500, err);
        }
  
        res.location = '/customers/' + inst._id;
        res.send(201, null);
      });
    };
  </code></pre>
  
  <p>This code is persisting a new document into MongoDB, and upon competition sets the location and send a <code>201</code> response. Got this response, no <code>Location</code> header is set:</p>
  
  <pre class="lang-none prettyprint-override"><code>HTTP/1.1 201 Created
  X-Powered-By: Express
  Content-Length: 0
  Date: Mon, 18 Feb 2013 19:08:41 GMT
  Connection: keep-alive
  </code></pre>
  
  <p><strong>EDIT</strong>: as <strong>uʍop ǝpısdn</strong> (cool nick btw) answer, <code>res.setHeader</code> works. But why <a href="http://expressjs.com/api.html#res.location" rel="noreferrer"><code>res.location</code></a> doesn't?</p>