Re: [nodejs] Add a Customized Message to the Response Header

2014-04-17 Thread Angel Java Lopez
First question: are you using Node.js, OR Node.js + Express (which version?)? On Thu, Apr 17, 2014 at 2:28 PM, JPJen wrote: > > > I am using Node.js. > > I have a piece of code that works well in returning the expected response > and the response is received quickly: > > if (req.accepts('json')

[nodejs] Add a Customized Message to the Response Header

2014-04-17 Thread JPJen
I am using Node.js. I have a piece of code that works well in returning the expected response and the response is received quickly: if (req.accepts('json')) { res.header('Content-Type', 'application/json'); res.send(res.locals.items, 200); } In addition to the Status 200, I