我已经从ref添加了以下代码。它按照预期给了我req.body。但是也可以记录response.body吗?怎么样。 我试图打印res.body它给了我很长的响应对象但不是实际的响应体。
app.middleware('initial', function logResponse(req, res, next) {
// install a listener for when the response is finished
res.on('finish', function() {
// the request was handled, print the log entry
console.log(res.body, req.originalUrl, res.statusCode);
});
// resume the routing pipeline,
// let other middleware to actually handle the request
next();
});