【发布时间】:2018-08-31 09:19:21
【问题描述】:
我不确定这是否可行,但我想在客户端查看 req 对象的全部内容。
const express = require('express');
const app = express();
app.get('/', (req, res) => {
// send req object to the client
res.json(req);
});
app.listen(5000, () => {
console.log('Server successfully started on port 5000');
});
这将导致如下错误:
TypeError:将循环结构转换为 JSON
【问题讨论】:
-
您将无法发送整个对象