Check the docs,HTTPClient是你需要使用的,它是一個標準。
第一步是在您的服務器上創建一個分析您的JSON格式的Web服務。您必須完成的大部分工作與Titanium無關,但是這裏是通過Titanium App發送POST請求將JSON對象發送到某個Web服務的代碼。
var xhr_getstep = Titanium.Network.createHTTPClient();
xhr_getstep.onload = function(e) {
// Do something with the response from the server
var responseBlob = this.responseText;
};
xhr_getstep.onerror = function() {
Ti.API.info('[ERROR] WebService failed.');
};
xhr_getstep.open("POST", 'http://yourwebsite.com/yourwebserviceentry.php');
xhr_getstep.setRequestHeader("Content-Type", "application/json");
// Create your object with info on how to create the PDF
var objSend = {title : 'Amazing Title'};
xhr_getstep.send(obj); // Send it all off