Node.JS Odd Behavior Receiving Post Data

I am sending XML data in a post request to my node.js server. The server is setup to accept post and have been running tests without an issue through CURL. Now I am attempting to get this same data through a POST request from multiple REST clients and through a plugin called Postman in Chrome. The end goal is to receive data to the server when an EXE file is kicked off.

The issue that I am running into is that the XML data seems to come in and stop at 1439 characters (the total characters is closer to 3900). It then receives the full 3900 characters. The issue is that the XML parser is seeing this as a bad XML doc as the first 1439 characters is killing the syntax. I have continued to test, but do not see why 1439 characters are sent and then followed up by the full 3900 characters.

Furthermore this doesn't appear to occur all the time. I have tested from these sources multiple times in a row and this behavior only seems to occur at random. The full code that I am using is listed below.

http.createServer(function (req, res) {
if(req.method=='POST'){
    var body='';
req.on('data', function (data) {
    body +=data;
    body = body.toString();
    var xmlDoc = libxmljs.parseXml(body));
    var status = xmlDoc.get('//Status').text();
    var ticket = xmlDoc.get('//Incident_ID').text();
    console.log(status + " " + ticket);
});
req.on('end', function(){

});
}
else if(req.method=='GET'){

    var url_parts = url.parse(req.url,true);

        spectrum['alarm'] = url_parts.query.AlarmID;
        spectrum['troubleshooter'] = url_parts.query.TroubleShooter;
        spectrum['title'] = url_parts.query.AlarmTitle;
        spectrum['date'] = url_parts.query.CreationDate;
        spectrum['model'] = url_parts.query.ModelName;
        spectrum['mac'] = url_parts.query.MAC;
        spectrum['ip'] = url_parts.query.IP;
        spectrum['severity'] = url_parts.query.Severity;
        spectrum['knowledge'] = url_parts.query.KnowledgeID;


    console.log("Contacted");

    console.log("got varabiles");
    eventEmitter.emit("gotVariables", spectrum);        
}

res.writeHead(200, {'Content-Type': 'text/plain'});
res.end("Request Submitted");

}).listen(1234, "localhost");

I am completely stuck as to why this is occurring and can't understand why it would be happening at random as it is. As it stands it only appears to happen with long data. When I send a simple 500 character XML doc it runs fine 100% of the time.

I did notice when using CURL that there is a header that says Expect: 100-continue. I have attempted to put this into the headers of the other requests to no avail. I may not be using it correctly or something may not be being handled in the node.js, but I'm not sure.

Hopefully this provides enough detail into what I'm attempting to do. I appreciate any assistance in troubleshooting this.

The data event is fired multiple times with chunks of data as they come in, you need to wait for them all to have been received by waiting to parse in the end event.

var chunks = [];
req.on('data', function (data) {
  chunks.push(data);
});
req.on('end', function(){
  var body = Buffer.concat(chunks).toString();

  var xmlDoc = libxmljs.parseXml(body));
  var status = xmlDoc.get('//Status').text();
  var ticket = xmlDoc.get('//Incident_ID').text();
  console.log(status + " " + ticket);
});