0
我一直在使用phonegap开发一个android应用程序。在应用程序中,我使用了xmlrpcrequest请求。有时,当我提出请求,可能是由于连接速度慢,请求超时,我得到以下错误WebUrlLoaderClient:同步请求超时后10
E/WebUrlLoaderClient(574):同步请求10秒0号超时后尝试
反正有“赶上”这个错误,或者可能增加超时时间?
我一直在使用phonegap开发一个android应用程序。在应用程序中,我使用了xmlrpcrequest请求。有时,当我提出请求,可能是由于连接速度慢,请求超时,我得到以下错误WebUrlLoaderClient:同步请求超时后10
E/WebUrlLoaderClient(574):同步请求10秒0号超时后尝试
反正有“赶上”这个错误,或者可能增加超时时间?
我有这个相同的问题,因为我更新到phonegap 2.8.1,你使用什么版本? 它似乎并没有听AJAX超时参数都:
var dataObj = { 'value': whatever'};
//navigator.notification.alert(JSON.stringify(dataObj));
$.ajax({
type: 'POST',
url: url,
async: false,
data: JSON.stringify(dataObj),
dataType: 'json',
timeout: 25000,
contentType: 'application/json; charset=utf-8',
crossDomain: true,
xhrFields: {
withCredentials: true
},
beforeSend: function(xhr) {
xhr.setRequestHeader("Authorization", "Basic " + Base64.encode(username + ":" + password));
},
success: post_succes,
error: function(xhr, status, errThrown) {
var out = "<br>Error status " + status;
out += "<br>Error request status text: " + xhr.statusText;
out += "<br>Error request status: " + xhr.status;
out += "<br>Error request response text: " + xhr.responseText;
out += "<br>Error response header: " + xhr.getAllResponseHeaders();
navigator.notification.alert(out);
}
});
我也试着设置在java主此值:(我知道这是不是正确的属性...但绝望认定它出...)
super.setIntegerProperty("loadUrlTimeoutValue", 25000);
它一直坚持到10秒....
在这里看到:http://stackoverflow.com/a/21882438/975443 – Kozuch 2014-02-19 13:51:45