[TIMOB-14734] Blackberry: Not getting this.responseText from Ti.Network.createHTTPClient
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-08-01T20:21:22.000+0000 |
Affected Version/s | Release 3.1.2 |
Fix Version/s | 2013 Sprint 16, 2013 Sprint 16 API, Release 3.2.0 |
Components | BlackBerry |
Labels | qe-3.1.2, qe-testadded |
Reporter | Priya Agarwal |
Assignee | Pedro Enrique |
Created | 2013-08-01T09:33:55.000+0000 |
Updated | 2014-06-19T12:42:46.000+0000 |
Description
Not getting this.responseText from Ti.Network.createHTTPClient.
Steps to reproduce:
1)Copy paste the code in app.js of default titanium project and run the app.
2)Click on the button 'create http client'.
Expected result:
1. Should see a window with label 'HTTP client test' & a button with text 'Create HTTP Client'.
2. Should see an alert with message ' Success. See console for output'.
You should see the HTML code for www.appcelerator.com. which is returned from this.responseText.
Actual Result:
1. A window with label 'HTTP client test' & a button with text 'Create HTTP Client'.
2. an alert with message ' Success. See console for output'. is seen.
In console do not get output of this.responseText.
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
var lbl = Ti.UI.createLabel({
text:'HTTP client test',
font:{fontSize:20},
top:20,
color:'brown'
});
var button = Ti.UI.createButton({
title:'Create HTTP client',
height:Ti.UI.SIZE,
width:Ti.UI.SIZE
});
button.addEventListener('click',function(e){
var url = "http://www.appcelerator.com";
var client = Ti.Network.createHTTPClient({
// function called when the response data is available
onload : function(e) {
Ti.API.info("Received text: " + this.responseText);
alert('Success. See console for output');
},
// function called when an error occurs, including a timeout
onerror : function(e) {
Ti.API.debug(e.error);
alert('Failed to get data');
},
timeout : 5000 // in milliseconds
});
// Prepare the connection.
client.open("GET", url);
// Send the request.
client.send();
});
win.add(lbl);
win.add(button);
win.open();
PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/141
Getting this.responseText from Ti.Network.createHTTPClient. Working as expected. Hence closing the issue. Tested Environment: Appcelerator Studio: 3.2.0.201311120707 SDK:3.2.0.v20131111174605 alloy: 1.3.0 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0 titanium-code-processor: 1.0.3 Xcode:5.0.1 Device: Blackeberry Z 10 OS: Mac OSX 10.9