PhoneGap Ajax请求返回502(坏网关),而AT&T数据,但不是在WiFi上
PhoneGap Ajax Request returns 502 (bad gateway) while on AT&T data but not on WiFi
使用PhoneGap制作iOS应用程序,我正在做一些非常简单的事情(向远程API发出ajax请求)。在我的物理设备(iPhone 4)上测试时,当我使用WiFi发出请求时一切正常,但当我通过at&t数据计划发出请求时,我得到502坏网关响应(如下)。我觉得它是在PhoneGap连接类,但我可能可能是错的…我知道我的服务器正在正确地接收请求,因为它在我的数据库中创建了一个实例,这只是响应在AT&T数据上被阻塞了。
这是我的AJAX打印输出和错误参数
$.ajax(
{
url : 'http://remotehost.com/api/users/login',
type : 'POST',
dataType : 'json',
data : $('#user_login').serializeArray(),
success : function(result)
{
}
});
2011-10-10 00:05:12.983 Emoome[481:707] [INFO] Object:
readyState = 4
setRequestHeader = function (a, b) {t===0&&(l[a.toLowerCase()]=b);return this;}
getAllResponseHeaders = function () {return t===2?m:null;}
getResponseHeader = function (a) {var b;if(t===2){if(!n){n={};while(b=bs.exec(m))n[b[1].toLowerCase()]=b[2]}b=n[a.toLowerCase()]}return b||null;}
abort = function (a) {a=a||"abort",o&&o.abort(a),w(0,a);return this;}
promise = function (a, c) {if(a==null){if(e)return e;e=a={}}c=z.length;while(c--)a[z[c]]=b[z[c]];return a;}
isRejected = function () {return c||b;}
isResolved = function () {return c||b;}
fail = function () {if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this;}
done = function () {if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this;}
then = function (a, c) {b.done(a).fail(c);return this;}
success = function () {if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this;}
error = function () {if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this;}
complete = function () {if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this;}
statusCode = function (a) {if(a){var b;if(t<2)for(b in a)k[b]=[k[b],a[b]];else b=a[v.status],v.then(b,b)}return this;}
responseText = <html><body><h1>502 Bad Gateway</h1>
The server returned an invalid or incomplete response.
</body></html>
status = 502
statusText = error
我终于弄明白了这个该死的问题。与at&t或PhoneGap无关……我们仍然不确定前者是否没有责任,因为at&t是阴暗的…这个问题实际上是在我的CodeIgniter REST服务器-我的应用程序正在为每个登录请求(ajax POST请求)创建一个新的会话条目,不知何故,当回到at&t的电线我的应用程序决定这是一个502错误,因为它没有看到cookie或会话数据。
对于仍然有这个问题的人,我也有这个问题。当我从应用程序向服务器发送请求时,我有一个setcookie函数。
这就是我所做的:setcookie('like'.$_POST[qid])。, '1', time() + (60 * 60), '/');
当我移除set cookie时,一切都很好。非常奇怪。
相关文章:
- 用程序搜索JQuery数据表中的文本
- 要求输入在数据列表中
- 正在将数据主题添加到所有项目
- 函数参数中的数据与指定变量之间的任何性能差异
- 在VanillaJS中模拟模型双向数据绑定
- CSS-如何定位内容数据标题
- 使用电话间隙在Android应用程序中显示SQL Lite的数据
- 无法在数据endVal中设置值=“”;{{ucount}}”;使用Angular JS的CountUp
- 序列化数据属性中对象的最可靠方法
- 如何将JSON数据导入我的ejs模板
- 不显示带有本地json文件数据的谷歌地图脚本
- 如何将json数据显示为html
- 画布数据到图像
- 使用jquery将mysql数据获取到新的表行中
- 使用html中的外部javascript进行数据验证
- 有时数据是't显示在浏览器中
- React中的数据集表示
- PhoneGap Ajax请求返回502(坏网关),而AT&T数据,但不是在WiFi上
- 在React Native中通过wifi发送数据
- 确定浏览器是否正在使用移动数据或wifi