Problem description
When sending a POST request, under some circumstances the event 'onsendstream' does not fire properly.
Test code
The following code is working fine for me, but fails for the customer - using different servers. It might be related to the information sent from the different servers; when the code fails, the event is only fired once with a negative progress value.
var request = Ti.Network.createHTTPClient({
onload: function() {
Ti.API.info(this.responseText);
},
onerror: function(e) {
Ti.API.info(JSON.stringify(e));
},
onsendstream: function(e) {
Ti.API.info('progress_onsendstream: ' + e.progress)
},
ondatastream: function(e) {
Ti.API.info('progress_ondatastream: ' + e.progress)
},
timeout: 60000
});
var f = Ti.Filesystem.getFile("somefile");
var cnt = f.read();
request.open("POST", serverurl);
request.setRequestHeader("Content-type", "application/json");
request.send({
"name": f.name,
"data": cnt,
});
Closing ticket due to the information that was requested was not provided.