Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13691] TiAPI: Ti.Network.HTTPClient ondatastream prototype doesn't fire

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.1.0
Fix Version/sn/a
ComponentsCore
Labelsapi
ReporterXiong Jun
AssigneeUnknown
Created2013-04-26T08:42:07.000+0000
Updated2018-02-28T20:03:21.000+0000

Description

When i using *Ti.Network.createHTTPClient* to create a *HTTPClient*, i wanna display upload progress on my app, the *ondatastream* event was bound like below:
var xhr = Ti.Network.createHTTPClient();
xhr.ondatastream = function(e){
    // progressing...
};
but *ondatastream* event was never ever fired, i was confused by this condition, WTF... finally, the solution is that you should only bind *ondatastream* like these:
var xhr = Ti.Network.createHTTPClient({
    ondatastream: function(e){ ... }
});
that's really ridiculous, i guess your guys forgot to implement the prototype of *ondatastream* for HTTPClient(or something else like getter and setter of property *ondatastream*). can you fix it? we really wanna use it like:
var xhr = Ti.Network.createHTTPClient();
xhr.ondatastream = function(e){
    // progressing...
};
{color:red}but not:{color}
var xhr = Ti.Network.createHTTPClient({
    ondatastream: function(e){ ... }
});
regards && thx.

Comments

No comments

JSON Source