Skip to content

Instantly share code, notes, and snippets.

@ryugoo
Created November 16, 2012 05:06
Show Gist options
  • Save ryugoo/4084298 to your computer and use it in GitHub Desktop.
Save ryugoo/4084298 to your computer and use it in GitHub Desktop.
HTTPClient send boolean values.
(function () {
var win = Ti.UI.createWindow({
title: "Window",
backgroundColor: "#FFFFFF"
}),
tableView = Ti.UI.createTableView({
data: []
}),
http = Ti.Network.createHTTPClient();
win.add(tableView);
http.open("POST", "http://ti.imthinker.net/httpclient.php");
http.onload = function () {
var json = JSON.parse(http.responseText);
tableView.data = [{
title: "boolTrueValue : " + json.boolTrueValue
}, {
title: "boolFalseValue : " + json.boolFalseValue
}];
};
http.onerror = function () {
alert("Connection error");
};
http.send({
boolTrueValue: true,
boolFalseValue: false
})
win.open();
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment