📅  最后修改于: 2022-03-11 15:03:53.429000             🧑  作者: Mango
res.setEncoding("utf-8");
let rawData = '';
res.on('data', (chunk) => { rawData += chunk; });
res.on('end', () => {
try {
const parsedData = JSON.parse(rawData);
console.log(parsedData);
} catch (e) {
console.error(e.message);
}