ASIHttpRequest发送一个奇怪的状态代码零.未到达服务器 [英] ASIHttpRequest send a weired status code of zero. Not reaching the server

查看:72
本文介绍了ASIHttpRequest发送一个奇怪的状态代码零.未到达服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPhone应用程序中使用ASIHTTPRequest框架来管理HTTP通信.我按照项目主页中给出的示例发送异步请求.在那里,我们必须实现两个回调,一个用于requestFinish,另一个用于requestFailed.

I use ASIHTTPRequest framework in my iPhone application to manage the HTTP communication. I followed their examples given in the project home page to send asynchronous requests. There we have to implement two callbacks, one for requestFinish and other for requestFailed.

但是,iPhone发送的请求中有60%的时间以"requestFinish"回调方法结束,并提供了有效的HTTP状态代码.但有时它会转到"requestFailed"回调,并且状态代码变为"0",这很令人困惑. 我的调查显示,互联网连接正常,我将请求发送到正确的URL,但是在服务器日志中未找到日志消息. 那么,为什么请求会如此随机地放在中间呢?有没有人遇到过这种类型的问题.将会非常有帮助.

However, 60% of the time requests sent by the iPhone ends up in the "requestFinish" callback method and gives a valid HTTP status code. But sometimes it goes to "requestFailed" callback and the status code become '0' which is confusing. My investigations revealed that the internet connection is ok, and I am sending the request to the correct URL, however no log messages found in server log. So why does the request gets dropped in the middle so randomly? Has anyone came across with this type of issue. Will be very helpful.

谢谢

推荐答案

与phooze所建议的一样,您可以启用ASIHTTPRequestConfig.h登录,这可以为正在发生的事情提供线索.

As well as what phooze suggested, there is logging in ASIHTTPRequestConfig.h that you can enable, that may provide a clue as to what is happening.

这篇关于ASIHttpRequest发送一个奇怪的状态代码零.未到达服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆