title: How to get list of HTTP response headers currently set in Node/Express?
body: <p>As I understand, when you are building a http response in node/express or whatever, the process consists of primarily two non-sequential steps: defining Headers and constructing the body. Headers include Set-Cookie headers.  In Express, the following methods are available with the response object for setting headers:</p>
  
  <pre><code>res.append(); // To append/create headers
  res.cookie(); // A convenience method to append set-cookie headers.
  </code></pre>
  
  <p>As headers are only buffered and not actually sent until the response is sent, is there any method or mechanism to get the current list of headers set, along with their values, something like:</p>
  
  <pre><code> headers = res.getHeaders(); //Returns an object with headers and values
   headers = res.getHeaders('Set-Cookie'); // To get only select headers
  </code></pre>