Open shfshanyue opened 3 years ago
在 Node 服务中,通过 http.createServer 接收到的 req 为可读流,对流进行读取数据
http.createServer
const server = http.createServer((req, res) => { let body = '' req.on('data', chunk => body += chunk) req.on('end', () => { data = body res.end(data) }) })
body-parser?
在 Node 服务中,通过
http.createServer
接收到的 req 为可读流,对流进行读取数据