是否有办法从 Titanium 执行 HTTP PUT/DELETE 方法?他们得到支持吗?是否有任何第三方库或解决方法可以处理它?</p>
最佳答案
是的,您可以在 HTTPClient 中将 PUT/DELETE 作为动词发送
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');
},
// function called when an error occurs, including a timeout
onerror : function(e) {
Ti.API.debug(e.error);
alert('error');
},
timeout : 5000 /* in milliseconds */
});
// Prepare the connection.
// This accepts PUT/DELETE/GET/POST
client.open("PUT", url);
// Send the request.
client.send();
关于javascript - 使用 Titanium 的 RESTful 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9347708/