【发布时间】:2014-06-01 17:53:52
【问题描述】:
我试图在 Titanium Studio 的 Coutch db 上向我的数据库发出请求。
我尝试了下面的代码,但出现错误:无法检索数据。
如果我尝试使用 ex url http://www.appcelerator.com, 我可以获得数据。
如果我使用 coutch db url http://127.0.0.1:5984,我无法获得任何数据 + 错误。
我想知道我是否应该使用另一个网址?
var url = "http://www.appcelerator.com";
var client = Ti.Network.createHTTPClient({
onload : function(e) {
Ti.API.info("Received text: " + this.responseText);
alert('success' + this.responseText);
},
onerror : function(e) {
Ti.API.debug(e.error);
alert('error');
},
timeout : 5000
});
client.open("GET", url);
client.send();
【问题讨论】:
标签: json titanium couchdb titanium-mobile getjson