事件发生后如何让反应机构得到解决?

时间:2013-07-08 01:44:11

标签: node.js events httpresponse restify

我尝试在下面的函数中调试/记录响应参数,但它不包含实际的主体。

功能(请求,响应,路由,错误){}

以上功能取自restify文档。下方链接: http://mcavage.me/node-restify/#Server-API

这是我的代码:

server.on('after', function(req, resp, route, error) {
    console.log(resp);
});

提前致谢!

1 个答案:

答案 0 :(得分:1)

阅读https://github.com/mcavage/node-restify/blob/master/lib/response.js

在第201行,您可以看到发送的真实身体位于resp._data