December 2014
Intermediate to advanced
160 pages
3h 4m
English
CHAPTER 6
![]()
Response
The Express.js response object (res for short)—which is an argument in the request handler callbacks—is the same good old Node.js http.response object1 on steroids. This is because the Express.js response object has new methods. In other words, the Express.js response object is the extension of the http.response class.
Why would some use these additional methods? Indeed, you can use the response.end() method2 and other core methods, but then you'll have to do write more code. For example, you would have to add Content-Type header manually. But with the Express.js response object which contains convenient wrappers, such as
Read now
Unlock full access