【发布时间】:2018-12-02 11:32:31
【问题描述】:
在对来自 createServer 的响应 Obj 使用 console.log 时,输出会在打印实际对象数据之前打印 ServerResponse。不知道res有什么特别之处,才会造成这种效果???
...
http.createServer((req, res) => {
// Parsing and Logging endpoint on console.
const URL = url.parse(req.url, true).pathname;
console.log(res);
});
...
【问题讨论】:
-
因为它是
ServerResponse。
标签: javascript node.js server response console.log