情況:客戶端js向nodejs express服務器發送一個jjax請求。如何在後端使用nodejs + express處理ajax/http-post請求(responsetype:arraybuffer)
客戶
xmlHttpRequest=new XMLHttpRequest();
xmlHttpRequest.open("POST","/some/server/path,true);
xmlHttpRequest.responseType="arraybuffer";
xmlHttpRequest.send(new Uint8Array(arraybufferobject));
服務器(到目前爲止)
var express = require('express');
var server = express();
server.use(express.static(__dirname));
server.use(express.bodyParser());
server.post('/goforms/modbus/',function(req,res,next){
//How to access the uint8array || arraybuffer ?
});
server.listen(80);
林停留在這一點上。如何訪問HTTP POST數據?
其空... reg.body = {} – Schemiii