We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4928b1a commit 9b1d421Copy full SHA for 9b1d421
g2-ssr/app.js
@@ -74,10 +74,15 @@ function toGet(req, res) {
74
75
//获取POST请求内容、cookie
76
function toPost(req, res) {
77
- req.on('data', async function (chunk) {
78
- console.log('data', chunk)
79
- await GenerateCharts(JSON.parse(chunk))
80
- console.log('toBuffer')
81
- res.end('complete');
+ const bodyChunks = []
+ req.on('data', function (chunk) {
+ console.log('data')
+ bodyChunks.push(chunk)
+ console.log('tobuffer')
82
+ });
83
+ res.end('complete', async () => {
84
+ const completeBodyBuffer = Buffer.concat(bodyChunks);
85
+ console.log('toBuffer', completeBodyBuffer.toString('utf8'))
86
+ await GenerateCharts(JSON.parse(completeBodyBuffer.toString('utf8')))
87
});
88
}
0 commit comments