Description
When performing a GET request and providing the optional data param the SDK will upgrade the request from GET to POST, this isn't in line with other platforms and causes problems for modules like ti.cloud which always send an empty data object
var win = Ti.UI.createWindow({
title: 'stuff',
backgroundColor: '#fff'
});
var label = Ti.UI.createLabel({
text: 'click me',
color: "#333",
font: {
fontSize: 20
}
});
label.addEventListener('click', function() {
var url = 'https://httpbin.org/anything';
var client = Ti.Network.createHTTPClient({
onload : function(e) {
alert("method was: " + JSON.parse(this.responseText).method);
Ti.API.info(this.responseText);
},
onerror : function(e) {
Ti.API.debug(e.error);
alert('error');
},
timeout : 5000
});
client.open("GET", url);
client.send({foo:'bar'});
})
win.add(label);
win.open()
Steps to reproduce
Add the above code to an existing app.js and build for Windows
Tap the label
Actual
Request is changed to a POST
Expected
Request should stay as get
Master: https://github.com/appcelerator/titanium_mobile_windows/pull/1112
Tested on SDK 7.0.0.v20171116132144 installed from CLI. Fix is verified.