[TIMOB-160] iPhone - status and statusText not working on HTTPClient object
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:52:11.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | ios, response, xhr |
Reporter | Kevin Whinnery |
Assignee | Reggie Seagraves |
Created | 2011-04-15T02:24:30.000+0000 |
Updated | 2011-05-15T22:18:51.000+0000 |
Description
When handling a response in HTTPClient's onreadystatechange handler function, the client object's status and statusText properties do not appear to be populated. Change the following lines in the XHR test in the Kitchen Sink to reproduce quickly:
var c = Titanium.Network.createHTTPClient();
// set on ready state change function
c.onreadystatechange = function()
{
Titanium.API.debug('>>>>>>>>>>>>>>>>>>>>>>>> readyState = ' + this.readyState);
Titanium.API.debug('>>>>>>>>>>>>>>>>>>>>>>>> status = ' + this.status);
Titanium.API.debug('>>>>>>>>>>>>>>>>>>>>>>>> statusText = ' + this.statusText);
if (this.readyState == 4)
{
document.getElementById('html').innerHTML = this.responseText;
}
};
// open the client
c.open('GET','http://www.google.com');
// send the data
c.send();
yeah, we need to make sure to fully implement the XHR spec.
Even now on 1.4.2 XHR spec doesn't appear to be fully implemented yet.
status never gets 404, 303 and other HTTP status codes other than 200.
also statusText never gets populated.
All properties which we still support (do not support statusText; separate bug dealing with XHR compliance, already filed) work properly.
Tested against 1.6.0 RC1
rollback wrong update
Tested on 1.6.2 -- 200 & 406 work, 401 gets absolutely no response, not even a status with the code number.