Program is working now, files attached
Thanks for the suggestions.
Checking the length in the header against the length of the data collected in the on('data') event and the proceeding to process the message and reply made it work.
var reqq;
var ress;
function doPost(req,res){
var length;
length=req.headers["Content-Length"];
reqq=req;ress=res;
req.on("data", function(d) {pdata+=d;if(pdata.length==length)doPost1(reqq,ress);});
req.on('close',"console.log(\"Closed\",pdata);");
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Program is working now, files attached
Thanks for the suggestions.
Checking the length in the header against the length of the data collected in the on('data') event and the proceeding to process the message and reply made it work.
2 Attachments