title: Get reponse message in Node using Request library?
body: <p>My backend server has the following code using Express:</p>
  
  <pre><code>router.post('/test', function(req, res) {
    res.end(res.writeHead(200, "custom message");
  });
  </code></pre>
  
  <p>When I make this post request in Node.js using Request library how do I get the "custom message"?</p>
  
  <pre><code>var request = require("request");
  request.post(options, function(error, response, body) {
    console.log(response.statusCode); //works
    console.log(JSON.stringify(response.headers)); //doesn't have my custom message 
  });
  </code></pre>
  
  <p>In c# I was able to get this message in the statusDecription property, how does it work in Request library?</p>
  
  <p>Edit:
  Solved with the following code:</p>
  
  <pre><code>router.post('/test', function(req, res) {
    res.end(res.writeHead(200, {"test": "custom message"});
  });
  </code></pre>
  
  <p>then</p>
  
  <pre><code>var request = require("request");
  request.post(options, function(error, response, body) {
    console.log(response.headers["test"]);  
  });
  </code></pre>