Tobi.js的回复机构?

时间:2012-02-16 12:11:08

标签: node.js browser

我正在使用浏览器模拟器https://github.com/LearnBoost/tobi来测试外部网络应用。我希望能够在回调中看到响应主体返回。

我理解node.js服务器端应用程序显示正文的正常方式是通过res.on('data'),但我的理解是在toby浏览器回调中,响应现在已经完成。然而,我找不到res.bodyres.data或类似的东西。我也找不到关于这个主题的文档!

function(error, response, $){ 
    // Headers are there
    console.log(response.headers;
    // Horrible hack to show body via jquery as response.body and response.data are undefined
    console.log($('body').html());
}

根据以上所述,我可以通过jQuery看到文档数据,所以就在那里。我只是在内部找不到它......

1 个答案:

答案 0 :(得分:1)

我认为你的jQuery用法是使用tobi的预期方式。它会消耗响应,并为您提供操作或检查它的$